Skip to content

Commit a6ad92e

Browse files
committed
add more test cases
1 parent 0729ae4 commit a6ad92e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

clang/lib/Parse/Parser.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,6 +1050,7 @@ Parser::ParseExternalDeclaration(ParsedAttributes &Attrs,
10501050
case tok::kw_extern:
10511051
if (getLangOpts().CPlusPlus && NextToken().is(tok::kw_template)) {
10521052
ProhibitAttributes(Attrs);
1053+
ProhibitAttributes(DeclSpecAttrs);
10531054
// Extern templates
10541055
SourceLocation ExternLoc = ConsumeToken();
10551056
SourceLocation TemplateLoc = ConsumeToken();
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
// RUN: %clang_cc1 -std=c++17 -verify %s
1+
// RUN: %clang_cc1 -std=c++17 -fms-extensions -verify %s
22

33
template <class>
44
struct S {};
55

6-
[[deprecated]] extern template struct S<int>; // expected-error {{an attribute list cannot appear here}}
6+
[[deprecated]] extern template struct S<int>; // expected-error {{an attribute list cannot appear here}}
7+
__attribute__((deprecated)) extern template struct S<int>; // expected-error {{an attribute list cannot appear here}}
8+
__declspec(deprecated) extern template struct S<int>; // expected-error {{expected unqualified-id}}

0 commit comments

Comments
 (0)