diff --git a/clang/include/clang/Basic/DiagnosticParseKinds.td b/clang/include/clang/Basic/DiagnosticParseKinds.td index 3a468d71f144..1364b982ecf1 100644 --- a/clang/include/clang/Basic/DiagnosticParseKinds.td +++ b/clang/include/clang/Basic/DiagnosticParseKinds.td @@ -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; - -def err_empty_attribute_block : Error< - "Microsoft attribute block cannot be empty">; - } // end of Parse Issue category. let CategoryName = "Modules Issue" in { diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp index d5360b547934..1d5443d6c96f 100644 --- a/clang/lib/Parse/ParseDeclCXX.cpp +++ b/clang/lib/Parse/ParseDeclCXX.cpp @@ -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) diff --git a/clang/test/Parser/MicrosoftExtensions.c b/clang/test/Parser/MicrosoftExtensions.c index 389cf6dfc03c..a29f6c0b5492 100644 --- a/clang/test/Parser/MicrosoftExtensions.c +++ b/clang/test/Parser/MicrosoftExtensions.c @@ -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); diff --git a/clang/test/Parser/MicrosoftExtensions.cpp b/clang/test/Parser/MicrosoftExtensions.cpp index 1686515d6881..e674d0101e97 100644 --- a/clang/test/Parser/MicrosoftExtensions.cpp +++ b/clang/test/Parser/MicrosoftExtensions.cpp @@ -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 + S(T); +} f([] {}); +}