summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-11-15 07:48:03 +0000
committerDouglas Gregor <dgregor@apple.com>2009-11-15 07:48:03 +0000
commitc473cbb3b231697efe25165ed933baaf5bb5edb7 (patch)
tree4948a038aeb5f6455ad89c6d9378241fa720dcb6 /clang/test
parent95148689c9fcc79b0d9dcc44f8a341fe7f5fa06a (diff)
downloadbcm5719-llvm-c473cbb3b231697efe25165ed933baaf5bb5edb7.tar.gz
bcm5719-llvm-c473cbb3b231697efe25165ed933baaf5bb5edb7.zip
When looking for operator() to type-check a call to an object of class
type, use full qualified name lookup rather than the poking the declaration context directly. This makes sure that we see operator()'s in superclasses. Also, move the complete-type check before this name lookup. llvm-svn: 88842
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaCXX/overloaded-operator.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/test/SemaCXX/overloaded-operator.cpp b/clang/test/SemaCXX/overloaded-operator.cpp
index 750038d4ab5..7762667d1ab 100644
--- a/clang/test/SemaCXX/overloaded-operator.cpp
+++ b/clang/test/SemaCXX/overloaded-operator.cpp
@@ -164,7 +164,11 @@ struct Callable2 {
double& operator()(...) const;
};
-void test_callable(Callable c, Callable2 c2, const Callable2& c2c) {
+struct DerivesCallable : public Callable {
+};
+
+void test_callable(Callable c, Callable2 c2, const Callable2& c2c,
+ DerivesCallable dc) {
int &ir = c(1);
float &fr = c(1, 3.14159, 17, 42);
@@ -175,6 +179,9 @@ void test_callable(Callable c, Callable2 c2, const Callable2& c2c) {
int &ir2 = c2();
int &ir3 = c2(1);
double &fr2 = c2c();
+
+ int &ir4 = dc(17);
+ double &fr3 = dc(3.14159f);
}
typedef float FLOAT;
OpenPOWER on IntegriCloud