]> granicus.if.org Git - clang/commit
[Parser] Emit descriptive diagnostic for misplaced pragma
authorSerge Pavlov <sepavloff@gmail.com>
Sun, 4 Aug 2019 10:08:51 +0000 (10:08 +0000)
committerSerge Pavlov <sepavloff@gmail.com>
Sun, 4 Aug 2019 10:08:51 +0000 (10:08 +0000)
commit0778fc61cf6933981705c2258d59ae82e79c9e24
tree7fdede2eec68c95592d2782beffc13cc1527da02
parentd985828d5afead32e20cb98d117c337f05cc32b9
[Parser] Emit descriptive diagnostic for misplaced pragma

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.

Differential Revision: https://reviews.llvm.org/D64932

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@367779 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticParseKinds.td
lib/Parse/ParseDecl.cpp
lib/Parse/ParseDeclCXX.cpp
test/Parser/pragma-attribute-context.cpp
test/Parser/pragma-fp-contract.c
test/Parser/pragma-fp-contract.cpp [new file with mode: 0644]