Skip to content

Commit 9fb5dd6

Browse files
committed
Add test to test the fallbacked output
1 parent fe009c3 commit 9fb5dd6

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

clang/lib/AST/ExprConstant.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2417,7 +2417,6 @@ static bool CheckEvaluationResult(CheckEvaluationResultKind CERK,
24172417
Info.Note(SubobjectDecl->getLocation(),
24182418
diag::note_constexpr_subobject_declared_here);
24192419
} else {
2420-
// FIXME: We should add a test to check the output of this case.
24212420
Info.FFDiag(DiagLoc, diag::note_constexpr_uninitialized) << false << Type;
24222421
}
24232422
return false;

clang/test/SemaCXX/constant-expression-cxx2a.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,3 +1492,9 @@ class B{
14921492
class D : B{}; // expected-error {{deleted function '~D' cannot override a non-deleted function}}
14931493
// expected-note@-1 {{destructor of 'D' is implicitly deleted because base class 'B' has an inaccessible destructor}}
14941494
}
1495+
1496+
namespace GH67317 {
1497+
constexpr unsigned char a = // expected-error {{constexpr variable 'a' must be initialized by a constant expression}} \
1498+
// expected-note {{subobject of type 'const unsigned char' is not initialized}}
1499+
__builtin_bit_cast(unsigned char, *new char[3][1]);
1500+
};

0 commit comments

Comments
 (0)