diff options
-rw-r--r-- | include/clang/AST/DeclarationName.h | 6 | ||||
-rw-r--r-- | test/SemaTemplate/destructor-template.cpp | 8 |
2 files changed, 12 insertions, 2 deletions
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<int>; } +namespace cvquals { + template<typename T> + void f(int *ptr) { + ptr->~T(); + } + + template void f<const volatile int>(int *); +} |