diff --git a/dmd/cpp/calypso.cpp b/dmd/cpp/calypso.cpp index 0c272e1b657..c701dc6d8cd 100644 --- a/dmd/cpp/calypso.cpp +++ b/dmd/cpp/calypso.cpp @@ -490,19 +490,6 @@ Identifier *getIdentifierOrNull(const clang::NamedDecl *D, SpecValue *spec, bool } } - if (isa(D)) - { - // Prefix reserved class names with 'ℂ' - if (ident == Id::Object || ident == Id::Throwable || ident == Id::Exception || ident == Id::Error || - ident == Id::TypeInfo || ident == Id::TypeInfo_Class || ident == Id::TypeInfo_Interface || - ident == Id::TypeInfo_Struct || ident == Id::TypeInfo_Pointer || - ident == Id::TypeInfo_Array || ident == Id::TypeInfo_StaticArray || ident == Id::TypeInfo_AssociativeArray || - ident == Id::TypeInfo_Enum || ident == Id::TypeInfo_Function || ident == Id::TypeInfo_Delegate || - ident == Id::TypeInfo_Tuple || ident == Id::TypeInfo_Const || ident == Id::TypeInfo_Invariant || - ident == Id::TypeInfo_Shared || ident == Id::TypeInfo_Wild || ident == Id::TypeInfo_Vector) // thanks C++... - needsPrefixing = true; - } - if (needsPrefixing) ident = prefixConflictingIdentifier(ident); diff --git a/dmd/cpp/cppaggregate.cpp b/dmd/cpp/cppaggregate.cpp index 1daff943caa..2b9878bbef6 100644 --- a/dmd/cpp/cppaggregate.cpp +++ b/dmd/cpp/cppaggregate.cpp @@ -56,7 +56,8 @@ void LangPlugin::mangleAnonymousAggregate(::AggregateDeclaration* ad, OutBuffer StructDeclaration::StructDeclaration(Loc loc, Identifier* id, const clang::RecordDecl* RD) { - construct_StructDeclaration(this, loc, id); + construct_StructDeclaration(this, loc, calypso.id_Scpp); + this->ident = id; // bypassed the reserved struct names check this->RD = RD; } @@ -68,7 +69,8 @@ StructDeclaration::StructDeclaration(const StructDeclaration& o) ClassDeclaration::ClassDeclaration(Loc loc, Identifier *id, BaseClasses *baseclasses, Dsymbols* members, const clang::CXXRecordDecl *RD) { - construct_ClassDeclaration(this, loc, id, baseclasses, members); + construct_ClassDeclaration(this, loc, calypso.id_Scpp, baseclasses, members); + this->ident = id; // bypassed the reserved class names check this->RD = RD; } @@ -80,7 +82,8 @@ ClassDeclaration::ClassDeclaration(const ClassDeclaration& o) UnionDeclaration::UnionDeclaration(Loc loc, Identifier* id, const clang::RecordDecl* RD) { - construct_UnionDeclaration(this, loc, id); + construct_UnionDeclaration(this, loc, calypso.id_Scpp); + this->ident = id; // bypassed the reserved struct names check this->RD = RD; }