| 9028 | } |
| 9029 | |
| 9030 | void dumpFallthrough() { |
| 9031 | const char code[] = "void f(int n) {\n" |
| 9032 | " void g(), h(), i();\n" |
| 9033 | " switch (n) {\n" |
| 9034 | " case 1:\n" |
| 9035 | " case 2:\n" |
| 9036 | " g();\n" |
| 9037 | " [[fallthrough]];\n" |
| 9038 | " case 3:\n" |
| 9039 | " h();\n" |
| 9040 | " break;\n" |
| 9041 | " default:\n" |
| 9042 | " i();\n" |
| 9043 | " break;\n" |
| 9044 | " }\n" |
| 9045 | "}"; |
| 9046 | SimpleTokenizer tokenizer(settingsDefault, *this, false); |
| 9047 | ASSERT(tokenizer.tokenize(code)); |
| 9048 | std::ostringstream ostr; |
| 9049 | tokenizer.dump(ostr); |
| 9050 | const std::string dump = ostr.str(); |
| 9051 | ASSERT(dump.find(" isAttributeFallthrough=\"true\"") != std::string::npos); |
| 9052 | } |
| 9053 | |
| 9054 | void simplifyRedundantParentheses() { |
| 9055 | const char code[] = "int f(struct S s) {\n" |