[PATCH] D68581: Include leading attributes in DeclStmt's SourceRange

2019-10-17 Thread Stephan Bergmann via Phabricator via cfe-commits
sberg marked 2 inline comments as done. sberg added inline comments. Comment at: clang/test/AST/sourceranges.cpp:155 + +#if __cplusplus >= 201703L + void cpp17() { aaron.ballman wrote: > Why is this guarded on C++17? `[[maybe_unused]]` is supported in every > l

[PATCH] D68581: Include leading attributes in DeclStmt's SourceRange

2019-10-17 Thread Stephan Bergmann via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGdc3957ec215d: Include leading attributes in DeclStmt's SourceRange (authored by sberg). Changed prior to commit: https://reviews.llvm.org/D68581?vs=224823&id=225397#toc Repository: rG LLVM Github Mon

[PATCH] D68581: Include leading attributes in DeclStmt's SourceRange

2019-10-16 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM, assuming the requested test changes are as successful as I expect they will be (doesn't need additional review if the tests pass). Comment at: clang/test

[PATCH] D68581: Include leading attributes in DeclStmt's SourceRange

2019-10-14 Thread Stephan Bergmann via Phabricator via cfe-commits
sberg updated this revision to Diff 224823. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68581/new/ https://reviews.llvm.org/D68581 Files: clang/lib/Parse/ParseStmt.cpp clang/test/AST/sourceranges.cpp Index: clang/test/AST/sourceranges.cpp =

[PATCH] D68581: Include leading attributes in DeclStmt's SourceRange

2019-10-13 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/AST/sourceranges.cpp:147 + +// CHECK-1Z: NamespaceDecl {{.*}} attributed_decl +namespace attributed_decl { I think these CHECK lines should just be a normal check instead of a C++17 check. CHANGES SIN

[PATCH] D68581: Include leading attributes in DeclStmt's SourceRange

2019-10-10 Thread Stephan Bergmann via Phabricator via cfe-commits
sberg updated this revision to Diff 224303. sberg edited the summary of this revision. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68581/new/ https://reviews.llvm.org/D68581 Files: clang/lib/Parse/ParseStmt.cpp clang/test/AST/sourceranges.cpp Index: clang/test/AST/sourceranges.cp

[PATCH] D68581: Include leading attributes in DeclStmt's SourceRange

2019-10-09 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. In D68581#1701787 , @aaron.ballman wrote: > I think this seems like reasonable behavior (for instance, we include the > location of a storage class specifier already), but I am curious if @rsmith > agrees. Yes, I do agree. Thou

[PATCH] D68581: Include leading attributes in DeclStmt's SourceRange

2019-10-09 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. I think this seems like reasonable behavior (for instance, we include the location of a storage class specifier already), but I am curious if @rsmith agrees. > Is there a good way to write a test for this? Yes, you can put an AST dumping test into the test\AST di

[PATCH] D68581: Include leading attributes in DeclStmt's SourceRange

2019-10-07 Thread Stephan Bergmann via Phabricator via cfe-commits
sberg created this revision. sberg added reviewers: aaron.ballman, rsmith, Nathan-Huckleberry. Herald added a project: clang. For a `DeclStmt` like [[maybe_unused]] int i; `getBeginLoc()` returned the start of `int` instead of the start of `[[` (see http://lists.llvm.org/pipermail/cfe-dev/201