File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -220,6 +220,8 @@ StmtResult Parser::ParseStatementOrDeclarationAfterAttributes(
220220 Decl =
221221 ParseDeclaration (DeclaratorContext::BlockContext, DeclEnd, Attrs);
222222 }
223+ if (Attrs.Range .getBegin ().isValid ())
224+ DeclStart = Attrs.Range .getBegin ();
223225 return Actions.ActOnDeclStmt (Decl, DeclStart, DeclEnd);
224226 }
225227
Original file line number Diff line number Diff line change @@ -92,6 +92,22 @@ struct map {
9292
9393}; // namespace std
9494
95+ // CHECK: NamespaceDecl {{.*}} attributed_decl
96+ namespace attributed_decl {
97+ void f () {
98+ // CHECK: DeclStmt {{.*}} <line:[[@LINE+1]]:5, col:28>
99+ [[maybe_unused]] int i1;
100+ // CHECK: DeclStmt {{.*}} <line:[[@LINE+1]]:5, col:35>
101+ __attribute__ ((unused)) int i2;
102+ // CHECK: DeclStmt {{.*}} <line:[[@LINE+1]]:5, col:35>
103+ int __attribute__ ((unused)) i3;
104+ // CHECK: DeclStmt {{.*}} <<built-in>:{{.*}}, {{.*}}:[[@LINE+1]]:40>
105+ __declspec (dllexport) extern int i4;
106+ // CHECK: DeclStmt {{.*}} <line:[[@LINE+1]]:5, col:40>
107+ extern int __declspec (dllexport) i5;
108+ }
109+ }
110+
95111#if __cplusplus >= 201703L
96112// CHECK-1Z: FunctionDecl {{.*}} construct_with_init_list
97113std::map<int , int > construct_with_init_list () {
You can’t perform that action at this time.
0 commit comments