================ @@ -0,0 +1,5 @@ +// RUN: %clang_cc1 -std=c23 -fsyntax-only -verify %s +// RUN: not %clang_cc1 -std=c99 -pedantic -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-EXT %s + +_Alignas(int) struct c1; // expected-warning {{attribute '_Alignas' before "struct" is ignored}} +alignas(int) struct c1; // expected-warning {{attribute 'alignas' before "struct" is ignored}} ---------------- jerinphilip wrote:
I tried to add a C23 test carrying over [D141177 (comment)](https://reviews.llvm.org/D141177#4606499_). The C23 test fails at the moment, because a CXX11 path is activated. My understanding is `alignas` being present pre C23 only in C++ has parse-paths that take the only C++ existence into consideration (from [isCXX11AttributeSpecifier](https://github.com/llvm/llvm-project/blob/041a786c78fbcee3537ca636bf796bb18fb6f313/clang/lib/Parse/ParseTentative.cpp#L740)). It ends up at https://github.com/llvm/llvm-project/blob/041a786c78fbcee3537ca636bf796bb18fb6f313/clang/include/clang/Parse/Parser.h#L2743 triggering the error messages to move it outward: https://github.com/llvm/llvm-project/blob/041a786c78fbcee3537ca636bf796bb18fb6f313/clang/lib/Parse/ParseDecl.cpp#L1791 Is it possible to decouple C23 from this what this PR addresses? https://github.com/llvm/llvm-project/pull/65638 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits