Skip to content

Commit 31c6dc6

Browse files
Add test case for pre-C++17-only aggregates
1 parent 7ddeb70 commit 31c6dc6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

clang/test/SemaCXX/uninitialized.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,6 +1515,9 @@ void aggregate() {
15151515

15161516
struct C {
15171517
[[clang::requires_explicit_initialization]] int c1; // #FIELD_C1
1518+
#if 201703L <= __cplusplus && __cplusplus < 202002L
1519+
// expected-warning@#FIELD_C1 {{explicit initialization of field 'c1' will not be enforced in C++20 and later because 'C' has a user-declared constructor, making the type no longer an aggregate}}
1520+
#endif
15181521
C() = default; // Test pre-C++20 aggregates
15191522
};
15201523

0 commit comments

Comments
 (0)