modernize-macro-to-enum creates a bunch of little insertions around a cluster of macros to turn this:
#define FOO1 1
#define FOO2 2
#define FOO3 3
into this
enum {
FOO1 = 1,
FOO2 = 2,
FOO3 = 3
};
The problem is that when the fixes are exported, the insertions of the = are not de-duplicated by clang-apply-replacements. So if clang-tidy is run with header-filter set to apply to application header files, the header files that have fixits issued in the course of analyzing multiple source files end up with invalid syntax llike this:
enum {
FOO1 = = 1,
FOO2 = = 2,
FOO3 = = 3
};
};
The fixes need to be recorded in such a way that they can be properly de-duplicated.
modernize-macro-to-enum
creates a bunch of little insertions around a cluster of macros to turn this:into this
The problem is that when the fixes are exported, the insertions of the
=
are not de-duplicated by clang-apply-replacements. So if clang-tidy is run with header-filter set to apply to application header files, the header files that have fixits issued in the course of analyzing multiple source files end up with invalid syntax llike this:The fixes need to be recorded in such a way that they can be properly de-duplicated.