[cfe-commits] r168267 - in /cfe/trunk: include/clang/Basic/DiagnosticCommonKinds.td include/clang/Lex/Preprocessor.h lib/Lex/PPMacroExpansion.cpp lib/Lex/Pragma.cpp lib/Lex/Preprocessor.cpp lib/Parse/ParseDecl.cpp lib/Parse/ParseDeclCXX.cpp lib/Parse/P

Andy Gibbs andyg1001 at hotmail.co.uk
Sat Nov 17 14:30:46 PST 2012


On Saturday, November 17, 2012 9:54 PM, Dmitri Gribenko wrote:
> On Sat, Nov 17, 2012 at 9:16 PM, Andy Gibbs <andyg1001 at hotmail.co.uk> 
> wrote:
>> --- cfe/trunk/lib/Lex/Pragma.cpp (original)
>> +++ cfe/trunk/lib/Lex/Pragma.cpp Sat Nov 17 13:16:52 2012
>> @@ -503,6 +503,7 @@
>>    Lex(Tok);
>>    std::string ArgumentString;
>>    if (Tok.is(tok::comma) && !LexStringLiteral(Tok, ArgumentString,
>> +                                              "pragma comment",
>>                                                /*MacroExpansion=*/true))
>
> Hi Andy,
>
> Does it make sense to sink the word 'pragma' into the message itself?
> The text "in %1" in the diagnostic is not an optimal solution IMHO.

I'm afraid I don't believe this can be easily done since the 
LexStringLiteral function is intended to be generic, i.e. not just for 
handling the parsing of pragmas -- for example, it is also utilised for the 
__has_warning builtin macro, where it produces the diagnostic "expected 
string literal in '__has_warning'".

Cheers
Andy

 




More information about the cfe-commits mailing list