summaryrefslogtreecommitdiffstats
path: root/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
commit352a8a419d7c9515bd05787c0390238f609cd4ae (patch)
treed1d0d75a4001cd621e4140752cd5d1aab0022520 /test
parente006e0409cc387a371e7a22c1ef84b3048a7deed (diff)
Reverted 321592: [Sema] Improve diagnostics for const- and ref-qualified member functions
A few tests need to be fixed git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321593 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CXX/over/over.match/over.match.funcs/p4-0x.cpp38
-rw-r--r--test/SemaCXX/copy-initialization.cpp2
2 files changed, 3 insertions, 37 deletions
diff --git a/test/CXX/over/over.match/over.match.funcs/p4-0x.cpp b/test/CXX/over/over.match/over.match.funcs/p4-0x.cpp
index df7762703c..68c79900b9 100644
--- a/test/CXX/over/over.match/over.match.funcs/p4-0x.cpp
+++ b/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/test/SemaCXX/copy-initialization.cpp b/test/SemaCXX/copy-initialization.cpp
index cd7e5f07e1..4f6c65cf55 100644
--- a/test/SemaCXX/copy-initialization.cpp
+++ b/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 {