]> granicus.if.org Git - clang/commitdiff
Top-level const changes do not make a qualification conversion. Fixes PR6089.
authorSebastian Redl <sebastian.redl@getdesigned.at>
Wed, 3 Feb 2010 19:36:07 +0000 (19:36 +0000)
committerSebastian Redl <sebastian.redl@getdesigned.at>
Wed, 3 Feb 2010 19:36:07 +0000 (19:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95239 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaOverload.cpp
test/CXX/conv/conv.qual/pr6089.cpp [new file with mode: 0644]

index d1d9bda93e552cc82c3a930a2112c45c7b1ad246..1319f337a6b051c3bbce20dfe28dcaf529abd3b7 100644 (file)
@@ -1421,7 +1421,7 @@ Sema::IsQualificationConversion(QualType FromType, QualType ToType) {
 
   // If FromType and ToType are the same type, this is not a
   // qualification conversion.
-  if (FromType == ToType)
+  if (FromType.getUnqualifiedType() == ToType.getUnqualifiedType())
     return false;
 
   // (C++ 4.4p4):
diff --git a/test/CXX/conv/conv.qual/pr6089.cpp b/test/CXX/conv/conv.qual/pr6089.cpp
new file mode 100644 (file)
index 0000000..ae75ec4
--- /dev/null
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+bool is_char_ptr( const char* );
+
+template< class T >
+        long is_char_ptr( T /* r */ );
+
+// Note: the const here does not lead to a qualification conversion
+template< class T >
+        void    make_range( T* const r, bool );
+
+template< class T >
+        void make_range( T& r, long );
+
+void first_finder( const char*& Search )
+{
+        make_range( Search, is_char_ptr(Search) );
+}