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

Stephan Bergmann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 17 05:44:51 PDT 2019


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 language mode used by this test (it generates a warning, but we're FileCheck'ing so that's fine -- but you could use `[[deprecated("")]]` instead if you want).
> 
> Additionally, I'd appreciate one more test case testing a `__declspec` attribute as well, to make sure we're handling that properly as well.
Oh, didn't know that [[maybe_unused]] would also be accepted in pre-C++17  modes (I was somehow under the false impression that this file would be processed as -std=c++11 by default, where [[deprecated("")]] wouldn't have worked either).
Testing both __attribute__ and __declspec at both the start and in the middle of the stmt now.  (One caveat with __declspec is that its location resolves to <builtin>, though.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68581/new/

https://reviews.llvm.org/D68581





More information about the cfe-commits mailing list