Fix argument-passing bugs in a call to object
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62147 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/overloaded-operator.cpp b/test/SemaCXX/overloaded-operator.cpp
index d8be6bc..e558faa 100644
--- a/test/SemaCXX/overloaded-operator.cpp
+++ b/test/SemaCXX/overloaded-operator.cpp
@@ -124,17 +124,29 @@
X& xr = (x, x);
}
-
struct Callable {
int& operator()(int, double = 2.71828); // expected-note{{candidate function}}
float& operator()(int, double, long, ...); // expected-note{{candidate function}}
+
+ double& operator()(float); // expected-note{{candidate function}}
};
-void test_callable(Callable c) {
+struct Callable2 {
+ int& operator()(int i = 0);
+ double& operator()(...) const;
+};
+
+void test_callable(Callable c, Callable2 c2, const Callable2& c2c) {
int &ir = c(1);
float &fr = c(1, 3.14159, 17, 42);
c(); // expected-error{{no matching function for call to object of type 'struct Callable'; candidates are:}}
+
+ double &dr = c(1.0f);
+
+ int &ir2 = c2();
+ int &ir3 = c2(1);
+ double &fr2 = c2c();
}
typedef float FLOAT;
diff --git a/test/SemaCXX/qualified-id-lookup.cpp b/test/SemaCXX/qualified-id-lookup.cpp
index c0d1ca3..cbc197d 100644
--- a/test/SemaCXX/qualified-id-lookup.cpp
+++ b/test/SemaCXX/qualified-id-lookup.cpp
@@ -33,6 +33,10 @@
namespace N {
struct f1 {
static int member;
+
+ typedef int type;
+
+ void foo(type);
};
void test_f1() {
@@ -40,8 +44,13 @@
}
}
+void N::f1::foo(int) { }
+
namespace N {
- float& f1(int);
+ float& f1(int x) {
+ N::f1::type& i1 = x;
+ // FIXME: currently fails f1::type& i2 = x;
+ }
struct f2 {
static int member;