File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -1705,6 +1705,9 @@ bool Compiler<Emitter>::VisitFixedPointUnaryOperator(const UnaryOperator *E) {
17051705template <class Emitter >
17061706bool Compiler<Emitter>::VisitImplicitValueInitExpr(
17071707 const ImplicitValueInitExpr *E) {
1708+ if (DiscardResult)
1709+ return true ;
1710+
17081711 QualType QT = E->getType ();
17091712
17101713 if (OptPrimType T = classify (QT))
Original file line number Diff line number Diff line change @@ -392,3 +392,12 @@ void plainComplex(void) {
392392 _Complex cd ; // all-warning {{_Complex double}}
393393 cd = * (_Complex * )& (struct { double r , i ; }){0.0 , 0.0 }; // all-warning {{_Complex double}}
394394}
395+
396+ /// This test results in an ImplicitValueInitExpr with DiscardResult set.
397+ struct M {};
398+ typedef struct S64 {
399+ struct M m ;
400+ char a [64 ];
401+ } I64 ;
402+
403+ _Static_assert ((((I64 ){}, 1 )), "" ); // all-warning {{left operand of comma operator has no effect}}
You can’t perform that action at this time.
0 commit comments