[cfe-commits] r75365 - /cfe/trunk/lib/AST/DeclCXX.cpp
Argyrios Kyrtzidis
kyrtzidis at apple.com
Sat Jul 11 15:05:05 PDT 2009
On Jul 11, 2009, at 2:46 PM, Daniel Dunbar wrote:
> Seems like a good candidate for an optional warning to implement in
> clang, in anticipation of the day when we self host. :)
Actually, clang also emits an error for this. The C++ standard does
not allow redeclaring names of the for-init-statement.
-Argiris
>
> - Daniel
>
> On Sat, Jul 11, 2009 at 7:32 AM, Alisdair Meredith<public at alisdairm.net
> > wrote:
>> Author: alisdairm
>> Date: Sat Jul 11 09:32:10 2009
>> New Revision: 75365
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=75365&view=rev
>> Log:
>> Fix breakage on Windows, cannot redeclare loop variable i in the
>> immediate scope of loop. Rename variable to j.
>>
>> Modified:
>> cfe/trunk/lib/AST/DeclCXX.cpp
>>
>> Modified: cfe/trunk/lib/AST/DeclCXX.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclCXX.cpp?rev=75365&r1=75364&r2=75365&view=diff
>>
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =====================================================================
>> --- cfe/trunk/lib/AST/DeclCXX.cpp (original)
>> +++ cfe/trunk/lib/AST/DeclCXX.cpp Sat Jul 11 09:32:10 2009
>> @@ -108,11 +108,11 @@
>> const CXXBaseSpecifier *VBase = Bases[i];
>> if (!VBase->isVirtual())
>> continue;
>> - int i;
>> - for (i = 0; i < vbaseCount; ++i)
>> - if (UniqueVbases[i]->getType() == VBase->getType())
>> + int j;
>> + for (j = 0; j < vbaseCount; ++j)
>> + if (UniqueVbases[j]->getType() == VBase->getType())
>> break;
>> - if (i == vbaseCount) {
>> + if (j == vbaseCount) {
>> UniqueVbases.push_back(VBase);
>> ++vbaseCount;
>> }
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list