Diagnose C++11 attributes before fp_contract pragmas.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194850 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Parse/ParseStmt.cpp b/lib/Parse/ParseStmt.cpp
index cf2199a..8f537ea 100644
--- a/lib/Parse/ParseStmt.cpp
+++ b/lib/Parse/ParseStmt.cpp
@@ -327,6 +327,7 @@
     return StmtEmpty();
 
   case tok::annot_pragma_fp_contract:
+    ProhibitAttributes(Attrs);
     Diag(Tok, diag::err_pragma_fp_contract_scope);
     ConsumeToken();
     return StmtError();
diff --git a/test/Parser/cxx11-stmt-attributes.cpp b/test/Parser/cxx11-stmt-attributes.cpp
index 2f727a2..9374b58 100644
--- a/test/Parser/cxx11-stmt-attributes.cpp
+++ b/test/Parser/cxx11-stmt-attributes.cpp
@@ -76,4 +76,9 @@
   }
 
   [[carries_dependency]] return; // expected-error {{'carries_dependency' attribute cannot be applied to a statement}}
+
+  {
+    [[ ]] // expected-error {{an attribute list cannot appear here}}
+#pragma STDC FP_CONTRACT ON // expected-error {{can only appear at file scope or at the start of a compound statement}}
+  }
 }