[cfe-commits] r95239 - in /cfe/trunk: lib/Sema/SemaOverload.cpp test/CXX/conv/conv.qual/pr6089.cpp
Sebastian Redl
sebastian.redl at getdesigned.at
Wed Feb 3 11:36:08 PST 2010
Author: cornedbee
Date: Wed Feb 3 13:36:07 2010
New Revision: 95239
URL: http://llvm.org/viewvc/llvm-project?rev=95239&view=rev
Log:
Top-level const changes do not make a qualification conversion. Fixes PR6089.
Added:
cfe/trunk/test/CXX/conv/conv.qual/pr6089.cpp
Modified:
cfe/trunk/lib/Sema/SemaOverload.cpp
Modified: cfe/trunk/lib/Sema/SemaOverload.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=95239&r1=95238&r2=95239&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaOverload.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOverload.cpp Wed Feb 3 13:36:07 2010
@@ -1421,7 +1421,7 @@
// 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):
Added: cfe/trunk/test/CXX/conv/conv.qual/pr6089.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/conv/conv.qual/pr6089.cpp?rev=95239&view=auto
==============================================================================
--- cfe/trunk/test/CXX/conv/conv.qual/pr6089.cpp (added)
+++ cfe/trunk/test/CXX/conv/conv.qual/pr6089.cpp Wed Feb 3 13:36:07 2010
@@ -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) );
+}
More information about the cfe-commits
mailing list