]> granicus.if.org Git - clang/commitdiff
Strip cv-qualifiers when building C++ constructor and destructor
authorDouglas Gregor <dgregor@apple.com>
Fri, 23 Apr 2010 04:51:46 +0000 (04:51 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 23 Apr 2010 04:51:46 +0000 (04:51 +0000)
names.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102171 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/DeclarationName.h
test/SemaTemplate/destructor-template.cpp

index a02e8d94ca95811a852f99a4a14011d6791e6248..94017865d4c6d84a1ed3d55c1d46b7ef43d24261 100644 (file)
@@ -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++
index 83b1beeea997d3e9e2dd0c636f7cc45e736c325f..fa1b3e0001c481009def8a14c66eb49d39839f6f 100644 (file)
@@ -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 *);
+}