r285281 - Fix MSVC warning about missing 'this' from lambda default capture mode

Simon Pilgrim via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 27 14:39:43 PDT 2016


> On 27 Oct 2016, at 13:25, Erik Verbruggen <erik.verbruggen at me.com> wrote:
> 
> Eh? Preprocessor::IsFileLexer(const IncludeStackInfo &) is static and doesn't need 'this'... Apparently MSVC mistakingly confuses that method with the non-static Preprocessor::IsFileLexer() method?

You’re not kidding, its incredibly annoying. I can add a comment explaining why its there if you wish?
Simon

>> On 27 Oct 2016, at 12:51, Simon Pilgrim via cfe-commits <cfe-commits at lists.llvm.org> wrote:
>> 
>> Author: rksimon
>> Date: Thu Oct 27 05:51:29 2016
>> New Revision: 285281
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=285281&view=rev
>> Log:
>> Fix MSVC warning about missing 'this' from lambda default capture mode
>> 
>> Modified:
>>   cfe/trunk/lib/Lex/PPLexerChange.cpp
>> 
>> Modified: cfe/trunk/lib/Lex/PPLexerChange.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPLexerChange.cpp?rev=285281&r1=285280&r2=285281&view=diff
>> ==============================================================================
>> --- cfe/trunk/lib/Lex/PPLexerChange.cpp (original)
>> +++ cfe/trunk/lib/Lex/PPLexerChange.cpp Thu Oct 27 05:51:29 2016
>> @@ -41,7 +41,7 @@ bool Preprocessor::isInPrimaryFile() con
>>  assert(IsFileLexer(IncludeMacroStack[0]) &&
>>         "Top level include stack isn't our primary lexer?");
>>  return std::none_of(IncludeMacroStack.begin() + 1, IncludeMacroStack.end(),
>> -                      [](const IncludeStackInfo &ISI) -> bool {
>> +                      [this](const IncludeStackInfo &ISI) -> bool {
>>    return IsFileLexer(ISI);
>>  });
>> }
>> 
>> 
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
> 



More information about the cfe-commits mailing list