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) {
243
243
case Stmt::GCCAsmStmtClass:
244
244
case Stmt::MSAsmStmtClass:
245
245
return visitAsmStmt (cast<AsmStmt>(S));
246
+ case Stmt::AttributedStmtClass:
247
+ return visitAttributedStmt (cast<AttributedStmt>(S));
246
248
case Stmt::NullStmtClass:
247
249
return true ;
248
250
default : {
@@ -625,6 +627,12 @@ bool ByteCodeStmtGen<Emitter>::visitAsmStmt(const AsmStmt *S) {
625
627
return this ->emitInvalid (S);
626
628
}
627
629
630
+ template <class Emitter >
631
+ bool ByteCodeStmtGen<Emitter>::visitAttributedStmt(const AttributedStmt *S) {
632
+ // Ignore all attributes.
633
+ return this ->visitStmt (S->getSubStmt ());
634
+ }
635
+
628
636
namespace clang {
629
637
namespace interp {
630
638
Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ class ByteCodeStmtGen final : public ByteCodeExprGen<Emitter> {
64
64
bool visitCaseStmt (const CaseStmt *S);
65
65
bool visitDefaultStmt (const DefaultStmt *S);
66
66
bool visitAsmStmt (const AsmStmt *S);
67
+ bool visitAttributedStmt (const AttributedStmt *S);
67
68
68
69
bool emitLambdaStaticInvokerBody (const CXXMethodDecl *MD);
69
70
Original file line number Diff line number Diff line change @@ -43,4 +43,11 @@ namespace InitDecl {
43
43
return false ;
44
44
}
45
45
static_assert (!f2(), " " );
46
+
47
+
48
+ constexpr int attrs () {
49
+ if (1 ) [[likely]] {}
50
+ return 1 ;
51
+ }
52
+ static_assert (attrs() == 1 , " " );
46
53
};
You can’t perform that action at this time.
0 commit comments