Use Sema's PrintingPolicy when diagnosing DeclSpecs.
authorBenjamin Kramer <benny.kra@googlemail.com>
Thu, 12 Mar 2015 14:28:38 +0000 (14:28 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Thu, 12 Mar 2015 14:28:38 +0000 (14:28 +0000)
commite4812148e13cbde16b24adaa261c42bdad52d80b
tree19af8e140b339a48791a787ba6140e260ac13d15
parente9f931f974ca72725836427f7f0d9f80ac7dee14
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
clang/lib/Parse/ParseDecl.cpp
clang/test/Sema/pr9812.c [moved from clang/test/SemaCXX/pr9812.c with 94% similarity]