[cfe-commits] r82874 - in /cfe/trunk: lib/CodeGen/Mangle.cpp test/CodeGenCXX/mangle-subst-std.cpp

Anders Carlsson andersca at mac.com
Sun Sep 27 09:09:03 PDT 2009


27 sep 2009 kl. 01.32 skrev Sebastian Redl:

> Anders Carlsson wrote:
>> Author: andersca
>> Date: Sat Sep 26 15:53:44 2009
>> New Revision: 82874
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=82874&view=rev
>> Log:
>> Substitute "::std::" as "St".
>>
> What happens if I do this?
>
> namespace mine { namespace std { void foo(); } }
>
> 1) Am I allowed to do this, i.e. may I use the identifier "std"  
> outside
> the global namespace? Do we want to allow it?

As far as Sema goes, I don't see why you wouldn't be allowed to do it.  
Neither GCC or EDG (or clang) complain about it.

> 2) Does the ABI want this substituted? (I think not.)

Nope - The subsitution rule explicitly states that std should only be  
substituted when it's a namespace in the global scope, so

class std {
	void foo();
};

isn't substituted either.

> 3) Will the code substitute it?

Nope.

Anders




More information about the cfe-commits mailing list