================
@@ -1195,6 +1195,41 @@ TEST_F(QualifierFixerTest,
QualifiersBrokenUpByPPDirectives) {
Style);
}
+TEST_F(QualifierFixerTest, QualifierOrderingAfterPreprocessorDirectives) {
+ auto Style = getLLVMStyle();
+ Style.QualifierAlignment = FormatStyle::QAS_Custom;
+ Style.QualifierOrder = {"static", "inline", "const", "type"};
+
+ verifyFormat("#if 1\n"
+ "void foo(const int par);\n"
+ "const int var1;\n"
+ "#endif\n"
+ "\n"
+ "const int var2;\n"
+ "const int var3;\n",
+ "#if 1\n"
+ "void foo(int const par);\n"
+ "int const var1;\n"
+ "#endif\n"
+ "\n"
+ "int const var2;\n"
+ "int const var3;\n",
----------------
HazardyKnusperkeks wrote:
```suggestion
"const int var3;",
"#if 1\n"
"void foo(int const par);\n"
"int const var1;\n"
"#endif\n"
"\n"
"int const var2;\n"
"int const var3;",
```
https://github.com/llvm/llvm-project/pull/160731
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits