From: Douglas Gregor Date: Fri, 23 Apr 2010 04:51:46 +0000 (+0000) Subject: Strip cv-qualifiers when building C++ constructor and destructor X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=20b3c9dda95e6808865110a21bfec25f95ebcaa7;p=clang Strip cv-qualifiers when building C++ constructor and destructor names. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102171 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/DeclarationName.h b/include/clang/AST/DeclarationName.h index a02e8d94ca..94017865d4 100644 --- a/include/clang/AST/DeclarationName.h +++ b/include/clang/AST/DeclarationName.h @@ -334,13 +334,15 @@ public: /// getCXXConstructorName - Returns the name of a C++ constructor /// for the given Type. DeclarationName getCXXConstructorName(CanQualType Ty) { - return getCXXSpecialName(DeclarationName::CXXConstructorName, Ty); + return getCXXSpecialName(DeclarationName::CXXConstructorName, + Ty.getUnqualifiedType()); } /// getCXXDestructorName - Returns the name of a C++ destructor /// for the given Type. DeclarationName getCXXDestructorName(CanQualType Ty) { - return getCXXSpecialName(DeclarationName::CXXDestructorName, Ty); + return getCXXSpecialName(DeclarationName::CXXDestructorName, + Ty.getUnqualifiedType()); } /// getCXXConversionFunctionName - Returns the name of a C++ diff --git a/test/SemaTemplate/destructor-template.cpp b/test/SemaTemplate/destructor-template.cpp index 83b1beeea9..fa1b3e0001 100644 --- a/test/SemaTemplate/destructor-template.cpp +++ b/test/SemaTemplate/destructor-template.cpp @@ -32,3 +32,11 @@ namespace PR6152 { template struct X; } +namespace cvquals { + template + void f(int *ptr) { + ptr->~T(); + } + + template void f(int *); +}