[PATCH] D55628: Add support for "labels" on push/pop directives in #pragma clang attribute

Erik Pilkington via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 19 13:34:50 PST 2018


erik.pilkington added inline comments.


================
Comment at: clang/lib/Parse/ParsePragma.cpp:3161
+      if (!Tok.is(tok::period)) {
+        PP.Diag(Tok.getLocation(), diag::err_pragma_attribute_expected_period)
+            << II;
----------------
aaron.ballman wrote:
> Can you reuse `diag::err_expected_after` instead of making a new diagnostic?
I was kinda concerned about how we would diagnose a case like this:
```
#pragma clang attribute add (...) // add isn't a thing!
```
A generic diagnostic about the missing `.` would be pretty unhelpful. The custom diagnostic reads as "expected '.' after pragma attribute namespace 'add'", which makes how the parser interpreted the code a lot more clear.


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

https://reviews.llvm.org/D55628





More information about the cfe-commits mailing list