diff options
Diffstat (limited to 'lib/Sema/SemaStmtAttr.cpp')
-rw-r--r-- | lib/Sema/SemaStmtAttr.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/Sema/SemaStmtAttr.cpp b/lib/Sema/SemaStmtAttr.cpp index 4ee3412170a8..e55e20c2827f 100644 --- a/lib/Sema/SemaStmtAttr.cpp +++ b/lib/Sema/SemaStmtAttr.cpp @@ -43,11 +43,11 @@ static Attr *handleFallThroughAttr(Sema &S, Stmt *St, const AttributeList &A, return nullptr; } - // If this is spelled as the standard C++1z attribute, but not in C++1z, warn + // If this is spelled as the standard C++17 attribute, but not in C++17, warn // about using it as an extension. - if (!S.getLangOpts().CPlusPlus1z && A.isCXX11Attribute() && + if (!S.getLangOpts().CPlusPlus17 && A.isCXX11Attribute() && !A.getScopeName()) - S.Diag(A.getLoc(), diag::ext_cxx1z_attr) << A.getName(); + S.Diag(A.getLoc(), diag::ext_cxx17_attr) << A.getName(); FnScope->setHasFallthroughStmt(); return ::new (S.Context) auto(Attr); @@ -100,16 +100,15 @@ static Attr *handleLoopHintAttr(Sema &S, Stmt *St, const AttributeList &A, return nullptr; } - LoopHintAttr::Spelling Spelling; + LoopHintAttr::Spelling Spelling = + LoopHintAttr::Spelling(A.getAttributeSpellingListIndex()); LoopHintAttr::OptionType Option; LoopHintAttr::LoopHintState State; if (PragmaNoUnroll) { // #pragma nounroll - Spelling = LoopHintAttr::Pragma_nounroll; Option = LoopHintAttr::Unroll; State = LoopHintAttr::Disable; } else if (PragmaUnroll) { - Spelling = LoopHintAttr::Pragma_unroll; if (ValueExpr) { // #pragma unroll N Option = LoopHintAttr::UnrollCount; @@ -121,7 +120,6 @@ static Attr *handleLoopHintAttr(Sema &S, Stmt *St, const AttributeList &A, } } else { // #pragma clang loop ... - Spelling = LoopHintAttr::Pragma_clang_loop; assert(OptionLoc && OptionLoc->Ident && "Attribute must have valid option info."); Option = llvm::StringSwitch<LoopHintAttr::OptionType>( |