================
@@ -0,0 +1,74 @@
+// RUN: %clang_cc1 -std=c++26 -fexperimental-new-constant-interpreter -x c++
%s -verify
+
+struct F {
+ bool V;
+};
+// Nominal cases
+// Type
+constexpr F f{true};
+struct [[=1]] f1 {};
+struct [[=1, =F{true}, =f]] f2 {};
+struct [[=1]] [[=2]] f3 {};
+// Declaration
+[[=1]] const F f4{}; // before declarator
+const F [[=1]] f40{}; // after declarator
+void f41([[=F{false}]]int i) {} // function parameters
+template<class T> [[=3]] void f42(T t); // non dep on template decl
+// Redeclaration
+[[=2, =3, =2]] void f5();
+void f5 [[=4, =2]] ();
+// Alias
+using A1 [[=1]] = int;
+// Error case
+// Right hand side of a alias declaration
+using A2 = [[=2]] int; // expected-error {{an attribute list cannot appear
here}}
+using A3 = int [[=2]]; // expected-error {{annotations are not permitted on
defining-type-id}}
----------------
zebullax wrote:
Added & checked
```
# .---command stderr------------
# | error: 'expected-error' diagnostics seen but not expected:
# | File
/Users/acassagnes/Documents/code/llvm-project/clang/test/SemaCXX/cxx26-annotation.cpp
Line 26: an attribute list cannot appear here
# | 1 error generated.
# `-----------------------------
# error: command failed with exit status: 1
```
https://github.com/llvm/llvm-project/pull/166287
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits