Displaying 3 results from an estimated 3 matches for "1f86c6e8".
2008 Oct 02
0
[LLVMdev] MS C++ gives error C2371 on this code while (obviously)gcc compiles it fine
...ngs for a VC++ project. I think it
was called something like "Enforce for loop conformance" or so...
This is something I always change though.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081002/1f86c6e8/attachment.html>
2008 Oct 02
3
[LLVMdev] MS C++ gives error C2371 on this code while (obviously) gcc compiles it fine
Taken from tools/llvmc2/CompilationGraph.cpp:
...
for (typename C::const_iterator B = EdgesContainer.begin(),
E = EdgesContainer.end(); B != E; ++B) {
const Edge* E = B->getPtr();
...
MS C++ compiler (VS 2008) gives:
...
CompilationGraph.cpp
..\..\..\llvm\tools\llvmc2\CompilationGraph.cpp(58) : error C2371:
'E' : redefinition; different basic types
2008 Oct 02
3
[LLVMdev] MS C++ gives error C2371 on this code while (obviously)gcc compiles it fine
gcc is correct. According to the ISO specification, the for-init-statement
is supposed to inject any variable names into the same declarative scope as
the condition of an equivalent restructuring of the loop in the form of a
while statement, which in turn fronts the declaration to an extra scope that
surrounds the /entire/ loop construct. VC++ seems to be scoping the
variables as if they were