diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-04-23 04:51:46 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-04-23 04:51:46 +0000 |
commit | 20b3c9dda95e6808865110a21bfec25f95ebcaa7 (patch) | |
tree | a131f43e5a752d1a531309c2a241347f7f177900 | |
parent | 6a03e345bb3c971750920e34a0d7d1ea7c9eceb7 (diff) |
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
-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 *); +} |