File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -243,6 +243,8 @@ bool ByteCodeStmtGen<Emitter>::visitStmt(const Stmt *S) {
243243 case Stmt::GCCAsmStmtClass:
244244 case Stmt::MSAsmStmtClass:
245245 return visitAsmStmt (cast<AsmStmt>(S));
246+ case Stmt::AttributedStmtClass:
247+ return visitAttributedStmt (cast<AttributedStmt>(S));
246248 case Stmt::NullStmtClass:
247249 return true ;
248250 default : {
@@ -625,6 +627,12 @@ bool ByteCodeStmtGen<Emitter>::visitAsmStmt(const AsmStmt *S) {
625627 return this ->emitInvalid (S);
626628}
627629
630+ template <class Emitter >
631+ bool ByteCodeStmtGen<Emitter>::visitAttributedStmt(const AttributedStmt *S) {
632+ // Ignore all attributes.
633+ return this ->visitStmt (S->getSubStmt ());
634+ }
635+
628636namespace clang {
629637namespace interp {
630638
Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ class ByteCodeStmtGen final : public ByteCodeExprGen<Emitter> {
6464 bool visitCaseStmt (const CaseStmt *S);
6565 bool visitDefaultStmt (const DefaultStmt *S);
6666 bool visitAsmStmt (const AsmStmt *S);
67+ bool visitAttributedStmt (const AttributedStmt *S);
6768
6869 bool emitLambdaStaticInvokerBody (const CXXMethodDecl *MD);
6970
Original file line number Diff line number Diff line change @@ -43,4 +43,11 @@ namespace InitDecl {
4343 return false ;
4444 }
4545 static_assert (!f2(), " " );
46+
47+
48+ constexpr int attrs () {
49+ if (1 ) [[likely]] {}
50+ return 1 ;
51+ }
52+ static_assert (attrs() == 1 , " " );
4653};
You can’t perform that action at this time.
0 commit comments