13.1-p3 Overloadable declarations
Parameter declarations that differ only in the presence or absence of const and/or volatile are equivalent.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83104 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h
index 14c71af..6022083 100644
--- a/lib/Sema/Sema.h
+++ b/lib/Sema/Sema.h
@@ -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
diff --git a/test/SemaCXX/function-overloaded-redecl.cpp b/test/SemaCXX/function-overloaded-redecl.cpp
new file mode 100644
index 0000000..4d8e57c
--- /dev/null
+++ b/test/SemaCXX/function-overloaded-redecl.cpp
@@ -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'}}
+
diff --git a/test/SemaCXX/overloaded-operator.cpp b/test/SemaCXX/overloaded-operator.cpp
index 02b47bd..77b5d6c 100644
--- a/test/SemaCXX/overloaded-operator.cpp
+++ b/test/SemaCXX/overloaded-operator.cpp
@@ -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()();
};