[llvm] r261396 - fixing msvc warning.

Mike Aizatsky via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 22 11:20:43 PST 2016


http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/421/steps/build/logs/warnings%20%281%29


C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\sancov\sancov.cc(724):
warning C4709: comma operator within array index expression




On Sun, Feb 21, 2016 at 3:38 PM David Blaikie <dblaikie at gmail.com> wrote:

> On Fri, Feb 19, 2016 at 6:11 PM, Mike Aizatsky via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>> Author: aizatsky
>> Date: Fri Feb 19 20:11:49 2016
>> New Revision: 261396
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=261396&view=rev
>> Log:
>> fixing msvc warning.
>>
>
> What was the MSVC warning?
>
>
>>
>> Modified:
>>     llvm/trunk/tools/sancov/sancov.cc
>>
>> Modified: llvm/trunk/tools/sancov/sancov.cc
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/sancov/sancov.cc?rev=261396&r1=261395&r2=261396&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/tools/sancov/sancov.cc (original)
>> +++ llvm/trunk/tools/sancov/sancov.cc Fri Feb 19 20:11:49 2016
>> @@ -721,7 +721,8 @@ public:
>>        if (!ProcessedFunctions.insert(FunctionName).second)
>>          continue;
>>
>> -      Result[FileLoc{FileName, Loc.Loc.Line}].insert(FunctionName);
>> +      auto FLoc = FileLoc{FileName, Loc.Loc.Line};
>>
>
> Could we just write this as:
>
> FileLoc FLoc = {FileName, Loc.Loc.Line};
>
> Or
>
> FileLoc FLoc(FileName, Loc.Loc.Line);
>
> (prefer the latter if we're actually calling a ctor, the former if it's
> really an aggregate with no user-declared ctor)
>
>
>> +      Result[FLoc].insert(FunctionName);
>>      }
>>      return Result;
>>    }
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160222/c969562c/attachment-0001.html>


More information about the llvm-commits mailing list