summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-07-14 19:54:05 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-07-14 19:54:05 +0000
commitb94afe1dd6bbc18679f5defc8fde313521aa0215 (patch)
tree9234ece55be4c26d2d3fb74ff30fd25453eee0c5 /clang/test
parent8c98230248d08be77b4c87478cabd5a626f7de6d (diff)
downloadbcm5719-llvm-b94afe1dd6bbc18679f5defc8fde313521aa0215.tar.gz
bcm5719-llvm-b94afe1dd6bbc18679f5defc8fde313521aa0215.zip
In C++98, if an rvalue reference binds to a function lvalue (or an xvalue or an
array prvalue), treat that as a direct binding. Only the class prvalue case needs to be excluded here; the rest are extensions anyway, so we can treat them as we would in C++11. llvm-svn: 212978
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaCXX/overload-call.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/clang/test/SemaCXX/overload-call.cpp b/clang/test/SemaCXX/overload-call.cpp
index 01f70b6b23d..19ce14481f8 100644
--- a/clang/test/SemaCXX/overload-call.cpp
+++ b/clang/test/SemaCXX/overload-call.cpp
@@ -592,10 +592,10 @@ void test5() {
}
namespace PR20218 {
- void f(void (*const &)()); // expected-note{{candidate}}
- void f(void (&&)()) = delete; // expected-note{{candidate}} expected-warning 2{{extension}}
- void g(void (&&)()) = delete; // expected-note{{candidate}} expected-warning 2{{extension}}
- void g(void (*const &)()); // expected-note{{candidate}}
+ void f(void (*const &)()); // expected-note 2{{candidate}}
+ void f(void (&&)()) = delete; // expected-note 2{{candidate}} expected-warning 2{{extension}}
+ void g(void (&&)()) = delete; // expected-note 2{{candidate}} expected-warning 2{{extension}}
+ void g(void (*const &)()); // expected-note 2{{candidate}}
void x();
typedef void (&fr)();
@@ -604,11 +604,7 @@ namespace PR20218 {
void h() {
f(x); // expected-error {{ambiguous}}
g(x); // expected-error {{ambiguous}}
-
- // OK! These ones try to copy-initialize a temporary of the reference's
- // underlying type, which only works for the pointer case and not for the
- // reference case.
- f(y);
- g(y);
+ f(y); // expected-error {{ambiguous}}
+ g(y); // expected-error {{ambiguous}}
}
}
OpenPOWER on IntegriCloud