[cfe-commits] r83104 - in /cfe/trunk: lib/Sema/Sema.h test/SemaCXX/function-overloaded-redecl.cpp test/SemaCXX/overloaded-operator.cpp
Fariborz Jahanian
fjahanian at apple.com
Tue Sep 29 13:28:06 PDT 2009
Author: fjahanian
Date: Tue Sep 29 15:28:06 2009
New Revision: 83104
URL: http://llvm.org/viewvc/llvm-project?rev=83104&view=rev
Log:
13.1-p3 Overloadable declarations
Parameter declarations that differ only in the presence or absence of const and/or volatile are equivalent.
Added:
cfe/trunk/test/SemaCXX/function-overloaded-redecl.cpp
Modified:
cfe/trunk/lib/Sema/Sema.h
cfe/trunk/test/SemaCXX/overloaded-operator.cpp
Modified: cfe/trunk/lib/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.h?rev=83104&r1=83103&r2=83104&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/Sema.h (original)
+++ cfe/trunk/lib/Sema/Sema.h Tue Sep 29 15:28:06 2009
@@ -3683,8 +3683,10 @@
QualType adjustFunctionParamType(QualType T) const {
if (!Context.getLangOptions().CPlusPlus)
return T;
-
- return T.getUnqualifiedType();
+ return
+ T->isDependentType() ? T.getUnqualifiedType()
+ : T.getDesugaredType().getUnqualifiedType();
+
}
/// \name Code completion
Added: cfe/trunk/test/SemaCXX/function-overloaded-redecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/function-overloaded-redecl.cpp?rev=83104&view=auto
==============================================================================
--- cfe/trunk/test/SemaCXX/function-overloaded-redecl.cpp (added)
+++ cfe/trunk/test/SemaCXX/function-overloaded-redecl.cpp Tue Sep 29 15:28:06 2009
@@ -0,0 +1,10 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+typedef const int cInt;
+
+void f (int);
+void f (const int); // redecl
+
+void f (int) { } // expected-note {{previous definition is here}}
+void f (cInt) { } // expected-error {{redefinition of 'f'}}
+
Modified: cfe/trunk/test/SemaCXX/overloaded-operator.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/overloaded-operator.cpp?rev=83104&r1=83103&r2=83104&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/overloaded-operator.cpp (original)
+++ cfe/trunk/test/SemaCXX/overloaded-operator.cpp Tue Sep 29 15:28:06 2009
@@ -155,7 +155,7 @@
typedef float& Func2(int, double);
struct ConvertToFunc {
- operator Func1*(); // expected-note{{conversion candidate of type 'INTREF (*)(FLOAT, double)'}}
+ operator Func1*(); // expected-note{{conversion candidate of type 'INTREF (*)(float, double)'}}
operator Func2&(); // expected-note{{conversion candidate of type 'float &(&)(int, double)'}}
void operator()();
};
More information about the cfe-commits
mailing list