[PATCH] D64932: [Parser] Emit descriptive diagnostic for misplaced pragma

Serge Pavlov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 18 09:47:52 PDT 2019


sepavloff created this revision.
sepavloff added reviewers: rsmith, rjmccall, erik.pilkington, ABataev.
Herald added a subscriber: dexonsmith.
Herald added a project: clang.

If a class or struct or union declaration contains a pragma that
is not valid in this context, compiler issues generic error like
"expected member name or ';' after declaration specifiers". With this
change the error tells that this pragma cannot appear in this declaration.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D64932

Files:
  clang/include/clang/Basic/DiagnosticParseKinds.td
  clang/include/clang/Basic/TokenKinds.h
  clang/include/clang/Parse/Parser.h
  clang/lib/Basic/TokenKinds.cpp
  clang/lib/Parse/ParseDecl.cpp
  clang/lib/Parse/ParseDeclCXX.cpp
  clang/lib/Parse/Parser.cpp
  clang/test/Parser/pragma-attribute-context.cpp
  clang/test/Parser/pragma-fp-contract.c
  clang/test/Parser/pragma-fp-contract.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64932.210610.patch
Type: text/x-patch
Size: 8025 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190718/10a0625f/attachment.bin>


More information about the cfe-commits mailing list