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
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
--- /dev/null
+// 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'}}
+
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()();
};