File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -2325,6 +2325,9 @@ bool Compiler<Emitter>::VisitCXXBindTemporaryExpr(
2325
2325
template <class Emitter >
2326
2326
bool Compiler<Emitter>::VisitCompoundLiteralExpr(const CompoundLiteralExpr *E) {
2327
2327
const Expr *Init = E->getInitializer ();
2328
+ if (DiscardResult)
2329
+ return this ->discard (Init);
2330
+
2328
2331
if (Initializing) {
2329
2332
// We already have a value, just initialize that.
2330
2333
return this ->visitInitializer (Init) && this ->emitFinishInit (E);
@@ -2378,9 +2381,6 @@ bool Compiler<Emitter>::VisitCompoundLiteralExpr(const CompoundLiteralExpr *E) {
2378
2381
if (!this ->visitInitializer (Init) || !this ->emitFinishInit (E))
2379
2382
return false ;
2380
2383
}
2381
-
2382
- if (DiscardResult)
2383
- return this ->emitPopPtr (E);
2384
2384
return true ;
2385
2385
}
2386
2386
Original file line number Diff line number Diff line change 1
1
// RUN: %clang_cc1 -std=c23 -fexperimental-new-constant-interpreter -verify=expected,both %s
2
2
// RUN: %clang_cc1 -std=c23 -verify=ref,both %s
3
3
4
-
4
+ typedef typeof ( nullptr ) nullptr_t ;
5
5
6
6
const _Bool inf1 = (1.0 /0.0 == __builtin_inf ());
7
7
constexpr _Bool inf2 = (1.0 /0.0 == __builtin_inf ()); // both-error {{must be initialized by a constant expression}} \
@@ -22,3 +22,6 @@ char bar() {
22
22
((struct S * )buffer )-> c = 'a' ;
23
23
return ((struct S * )buffer )-> c ;
24
24
}
25
+
26
+
27
+ static_assert ((nullptr_t ){} == 0 );
You can’t perform that action at this time.
0 commit comments