forked from llvm/llvm-project
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
"Reapply "[Sema] Fix crash on invalid code with parenthesized aggrega… (
llvm#76833) …te initialization" (llvm#76272)"" With updates the libc++ tests. This reverts commit 2205d23 and relands 86dc6e1 and 7ab16fb. Original commit was reverted because of failing libc++ tests, see llvm#76232 for the discussion. The errors in the tests are spurious in the first place (coming from initialization of invalid classes), so update the tests to match new behavior that does not show those errors. The original patch was written by @ilya-biryukov To fix the CI two libc++ tests are temporary disabled for clang-18.
- Loading branch information
Showing
5 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// RUN: %clang_cc1 -std=c++20 -verify %s | ||
// Check we don't crash on incomplete members and bases when handling parenthesized initialization. | ||
class incomplete; // expected-note@-0 3 {{forward declaration of 'incomplete'}} | ||
struct foo { | ||
int a; | ||
incomplete b; | ||
// expected-error@-1 {{incomplete type}} | ||
}; | ||
foo a1(0); | ||
|
||
struct one_int { | ||
int a; | ||
}; | ||
struct bar : one_int, incomplete {}; | ||
// expected-error@-1 {{incomplete type}} | ||
bar a2(0); | ||
|
||
incomplete a3[3](1,2,3); | ||
// expected-error@-1 {{incomplete type}} | ||
|
||
struct qux : foo { | ||
}; | ||
qux a4(0); | ||
|
||
struct fred { | ||
foo a[3]; | ||
}; | ||
fred a5(0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters