Ambiguous mangling of symbols declared in nested scopes

Daniel Murphy via Digitalmars-d digitalmars-d at puremagic.com
Thu Jul 17 23:04:50 PDT 2014


"H. S. Teoh via Digitalmars-d"  wrote in message 
news:mailman.4366.1405642929.2907.digitalmars-d at puremagic.com...

> Hmm. How to generate a unique id? It must be module-wide, but not
> program-wide, because otherwise you get a different mangling depending
> on the order of imports. It must not increment within the same scope:

An easy option is to just have a counter inside the enclosing fd and 
increment it each time a local is created.  In D I'd do it with an 
int[string] to track each name independently, but it's probably not worth 
the trouble in C++.  These mangled names are not externally visible and do 
not need to be stable, just unique. 



More information about the Digitalmars-d mailing list