diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2015-03-12 14:28:38 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2015-03-12 14:28:38 +0000 |
commit | e4812148e13cbde16b24adaa261c42bdad52d80b (patch) | |
tree | 19af8e140b339a48791a787ba6140e260ac13d15 /clang/lib | |
parent | e9f931f974ca72725836427f7f0d9f80ac7dee14 (diff) | |
download | bcm5719-llvm-e4812148e13cbde16b24adaa261c42bdad52d80b.tar.gz bcm5719-llvm-e4812148e13cbde16b24adaa261c42bdad52d80b.zip |
Use Sema's PrintingPolicy when diagnosing DeclSpecs.
Sema overrides ASTContext's policy on the first emitted diagnostic
(doesn't matter if it's ignored or not). This means changing the order
of diagnostic emission in Sema suddenly changes the text of diagnostic
emitted from the parser.
In the test case -Wmissing-prototypes (ignored) was the culprit, use
'int main' to suppress that warning so we see when this regresses.
Also move it into Sema/ as it's not testing any C++.
llvm-svn: 232039
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index cea58248107..b4a76642981 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -2569,7 +2569,8 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, bool EnteringContext = (DSContext == DSC_class || DSContext == DSC_top_level); bool AttrsLastTime = false; ParsedAttributesWithRange attrs(AttrFactory); - const PrintingPolicy &Policy = Actions.getASTContext().getPrintingPolicy(); + // We use Sema's policy to get bool macros right. + const PrintingPolicy &Policy = Actions.getPrintingPolicy(); while (1) { bool isInvalid = false; bool isStorageClass = false; |