ArcsinX marked an inline comment as done.
ArcsinX added inline comments.

================
Comment at: clang/lib/Parse/ParseDeclCXX.cpp:79
+
+  auto ReadLabelAttrubutes = [&] {
+    // Read label attributes, if present.
----------------
aaron.ballman wrote:
> However, I don't think there's a reason we need this lambda -- it seems we 
> can call `MaybeParseGNUAttributes()` instead, and get the attribute location 
> from the `ParsedAttributesWithRange` object passed in.
`MaybeParseAttributes(PAKM_GNU | PAKM_CXX11, Attrs)` parses different kind of 
attributes in a loop (e.g. `struct __attribute__(()) [[]] [[]] 
__attribute__(()) S {};` is valid for clang), but we can't use it because we 
need to warn about c++11 attributes usage for namespace if c++ < 17. So, I 
added a lambda which works similar to `MaybeParseAttributes()`.

Thus, now clang handles attributes for namespace like it handle attributes for 
structure.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121245

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to