fix for -O C++ construction of variable names that use multiple module namespaces

This commit is contained in:
Vern Paxson 2024-08-09 09:27:22 -07:00 committed by Arne Welzel
parent 6faad5e5ca
commit 202c405a1e

View file

@ -111,10 +111,12 @@ string CPPCompile::LocalName(const ID* l) const {
auto n = l->Name();
auto without_module = strstr(n, "::");
if ( without_module )
return Canonicalize(without_module + 2);
else
return Canonicalize(n);
while ( without_module ) {
n = without_module + 2;
without_module = strstr(n, "::");
}
return Canonicalize(n);
}
string CPPCompile::Canonicalize(const char* name) const {