]> granicus.if.org Git - clang/commitdiff
Revert "parser: wordsmith diagnostic message" and "parser: diagnose empty attribute...
authorDavid Majnemer <david.majnemer@gmail.com>
Wed, 8 Jul 2015 05:55:00 +0000 (05:55 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Wed, 8 Jul 2015 05:55:00 +0000 (05:55 +0000)
This reverts commit r239846 and r239879.  They caused clang's
-fms-extensions behavior to incorrectly parse lambdas and includes a
testcase to ensure we don't regress again.

This issue was found in PR24027.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241668 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticParseKinds.td
lib/Parse/ParseDeclCXX.cpp
test/Parser/MicrosoftExtensions.c
test/Parser/MicrosoftExtensions.cpp

index 3a468d71f14469a4e215122c2aeff31d0e130af2..1364b982ecf16c26f6eb13dc58c92594a75ece51 100644 (file)
@@ -1004,10 +1004,6 @@ def err_pragma_invalid_keyword : Error<
 def warn_pragma_unroll_cuda_value_in_parens : Warning<
   "argument to '#pragma unroll' should not be in parentheses in CUDA C/C++">,
   InGroup<CudaCompat>;
-
-def err_empty_attribute_block : Error<
-  "Microsoft attribute block cannot be empty">;
-
 } // end of Parse Issue category.
 
 let CategoryName = "Modules Issue" in {
index d5360b547934ddc5f5864d7a26001d8b54cf4b76..1d5443d6c96fe15f9cdbe088083953177fd0493c 100644 (file)
@@ -3814,7 +3814,7 @@ SourceLocation Parser::SkipCXX11Attributes() {
   return EndLoc;
 }
 
-/// Parse one or more Microsoft-style attributes [Attr]
+/// ParseMicrosoftAttributes - Parse Microsoft attributes [Attr]
 ///
 /// [MS] ms-attribute:
 ///             '[' token-seq ']'
@@ -3830,8 +3830,6 @@ void Parser::ParseMicrosoftAttributes(ParsedAttributes &attrs,
     // FIXME: If this is actually a C++11 attribute, parse it as one.
     BalancedDelimiterTracker T(*this, tok::l_square);
     T.consumeOpen();
-    if (Tok.is(tok::r_square))
-      Diag(T.getOpenLocation(), diag::err_empty_attribute_block);
     SkipUntil(tok::r_square, StopAtSemi | StopBeforeMatch);
     T.consumeClose();
     if (endLoc)
index 389cf6dfc03c6b57d0fe4e5049aa76158c5b2ae4..a29f6c0b54927a443c71eaed45f795f62eed85c4 100644 (file)
@@ -55,8 +55,6 @@ int foo1([SA_Post(attr=1)] void *param);
 [unbalanced(attribute) /* expected-note {{to match this '['}} */
 void f(void); /* expected-error {{expected ']'}} */
 
-[] __interface I {}; /* expected-error {{Microsoft attribute block cannot be empty}} */
-
 void ms_intrinsics(int a) {
   __noop();
   __assume(a);
index 1686515d68816e4ad4af466610f76faf6770e0ca..e674d0101e971978b13eacc34ae42148a2d95b40 100644 (file)
@@ -400,3 +400,10 @@ static_assert(__alignof(struct align_before_key1) == 16, "");
 static_assert(__alignof(struct align_before_key2) == 16, "");
 static_assert(__alignof(struct align_before_key3) == 16, "");
 }
+
+namespace PR24027 {
+struct S {
+  template <typename T>
+  S(T);
+} f([] {});
+}