[cfe-commits] r112977 - in /cfe/trunk: include/clang/Lex/Token.h lib/Lex/Preprocessor.cpp lib/Parse/ParseObjc.cpp

Fariborz Jahanian fjahanian at apple.com
Fri Sep 3 11:02:36 PDT 2010


On Sep 3, 2010, at 10:47 AM, Chris Lattner wrote:

> On Sep 3, 2010, at 10:33 AM, Fariborz Jahanian wrote:
>> URL: http://llvm.org/viewvc/llvm-project?rev=112977&view=rev
>> Log:
>> Use getSpelling to get original text of the
>> c++ operator token. (radar 8328250).
>
> Thanks Fariborz, one gotcha here:
>>
>
> PP.getSpelling(Tok) returns an std::string, which will be destroyed  
> at the end of the statement.  This causes the StringRef (which is  
> basically a pointer + length) to dangle.  There are a couple of  
> different ways to fix this, but the simplest is to declare ThisTok  
> as an std::string.
In r112979.

- Fariborz

>



More information about the cfe-commits mailing list