================ @@ -0,0 +1,17 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -Wduplicate-decl-specifier %s +// RUN: %clang_cc1 -fsyntax-only -verify -Wc++-compat %s +// RUN: %clang_cc1 -fsyntax-only -verify -Wno-duplicate-decl-specifier -Wc++-compat %s +// RUN: %clang_cc1 -fsyntax-only -verify=good -Wc++-compat -Wno-duplicate-decl-specifier %s +// RUN: %clang_cc1 -fsyntax-only -verify=good -Wno-duplicate-decl-specifier %s +// RUN: %clang_cc1 -fsyntax-only -verify -x c++ %s +// good-no-diagnostics + +// Note: we treat this as a warning in C++, so you get the same diagnostics in +// either language mode. However, GCC diagnoses this as an error, so the +// compatibility warning has value. +const const int i = 12; // expected-warning {{duplicate 'const' declaration specifier}} ---------------- shafik wrote:
`volatile const volatile const int x = 1;` might also be worth checking, to get in `volatile` and test that we catch alternating qualifies. https://github.com/llvm/llvm-project/pull/138012 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits