summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorJacob Bandes-Storch <jacob@bandes-stor.ch>2017-12-31 05:13:03 +0000
committerJacob Bandes-Storch <jacob@bandes-stor.ch>2017-12-31 05:13:03 +0000
commit1dbc09363a03be45163db9526895ba16b14ba7c6 (patch)
treeda14e6727139b4066a32c488ac2057684980e15c /clang/test
parentc7e67a04e0f33f4e79b23829fd26ba142cf69b00 (diff)
downloadbcm5719-llvm-1dbc09363a03be45163db9526895ba16b14ba7c6.tar.gz
bcm5719-llvm-1dbc09363a03be45163db9526895ba16b14ba7c6.zip
Reverted 321592: [Sema] Improve diagnostics for const- and ref-qualified member functions
A few tests need to be fixed llvm-svn: 321593
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CXX/over/over.match/over.match.funcs/p4-0x.cpp38
-rw-r--r--clang/test/SemaCXX/copy-initialization.cpp2
2 files changed, 3 insertions, 37 deletions
diff --git a/clang/test/CXX/over/over.match/over.match.funcs/p4-0x.cpp b/clang/test/CXX/over/over.match/over.match.funcs/p4-0x.cpp
index df7762703c0..68c79900b95 100644
--- a/clang/test/CXX/over/over.match/over.match.funcs/p4-0x.cpp
+++ b/clang/test/CXX/over/over.match/over.match.funcs/p4-0x.cpp
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
template<typename T> T &lvalue();
template<typename T> T &&xvalue();
@@ -19,18 +20,6 @@ struct X0 {
void g();
- void c() const; // expected-note {{'c' declared here}}
- void v() volatile; // expected-note {{'v' declared here}}
- void r() __restrict__; // expected-note {{'r' declared here}}
- void cr() const __restrict__; // expected-note {{'cr' declared here}}
- void cv() const volatile;
- void vr() volatile __restrict__; // expected-note {{'vr' declared here}}
- void cvr() const volatile __restrict__;
-
- void lvalue() &; // expected-note 2 {{'lvalue' declared here}}
- void const_lvalue() const&;
- void rvalue() &&; // expected-note {{'rvalue' declared here}}
-
int &operator+(const X0&) &;
float &operator+(const X0&) &&;
@@ -43,7 +32,7 @@ struct X0 {
float &h2() const&&;
};
-void X0::g() { // expected-note {{'g' declared here}}
+void X0::g() {
int &ir1 = f();
int &ir2 = X0::f();
}
@@ -80,26 +69,3 @@ void test_ref_qualifier_overloading() {
float &fr3 = xvalue<X0>().h2();
float &fr4 = prvalue<X0>().h2();
}
-
-void test_diagnostics(const volatile X0 &__restrict__ cvr) {
- cvr.g(); // expected-error {{'this' argument to member function 'g' has type 'const volatile X0', but function is not marked const or volatile}}
- cvr.c(); // expected-error {{not marked volatile}}
- cvr.v(); // expected-error {{not marked const}}
- cvr.r(); // expected-error {{not marked const or volatile}}
- cvr.cr(); // expected-error {{not marked volatile}}
- cvr.cv();
- cvr.vr(); // expected-error {{not marked const}}
- cvr.cvr();
-
- lvalue<X0>().lvalue();
- lvalue<X0>().const_lvalue();
- lvalue<X0>().rvalue(); // expected-error {{'this' argument to member function 'rvalue' is an lvalue, but function has rvalue ref-qualifier}}
-
- xvalue<X0>().lvalue(); // expected-error {{'this' argument to member function 'lvalue' is an rvalue, but function has non-const lvalue ref-qualifier}}
- xvalue<X0>().const_lvalue();
- xvalue<X0>().rvalue();
-
- prvalue<X0>().lvalue(); // expected-error {{'this' argument to member function 'lvalue' is an rvalue, but function has non-const lvalue ref-qualifier}}
- prvalue<X0>().const_lvalue();
- prvalue<X0>().rvalue();
-}
diff --git a/clang/test/SemaCXX/copy-initialization.cpp b/clang/test/SemaCXX/copy-initialization.cpp
index cd7e5f07e14..4f6c65cf550 100644
--- a/clang/test/SemaCXX/copy-initialization.cpp
+++ b/clang/test/SemaCXX/copy-initialization.cpp
@@ -26,7 +26,7 @@ struct foo {
};
// PR3600
-void test(const foo *P) { P->bar(); } // expected-error{{'this' argument to member function 'bar' has type 'const foo', but function is not marked const}}
+void test(const foo *P) { P->bar(); } // expected-error{{'bar' not viable: 'this' argument has type 'const foo', but function is not marked const}}
namespace PR6757 {
struct Foo {
OpenPOWER on IntegriCloud