summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/copy-initialization.cpp
diff options
context:
space:
mode:
authorJacob Bandes-Storch <jacob@bandes-stor.ch>2017-12-31 18:27:29 +0000
committerJacob Bandes-Storch <jacob@bandes-stor.ch>2017-12-31 18:27:29 +0000
commitbb93578108c522906016fd851d1a8fa63bc048f5 (patch)
tree6d9c8800455a8d4b7066a37b6b364b793e21204b /clang/test/SemaCXX/copy-initialization.cpp
parente940b86c5f28927dfe85647be7ceba3177ddc6d1 (diff)
downloadbcm5719-llvm-bb93578108c522906016fd851d1a8fa63bc048f5.tar.gz
bcm5719-llvm-bb93578108c522906016fd851d1a8fa63bc048f5.zip
[Sema] Improve diagnostics for const- and ref-qualified member functions
(Re-submission of D39937 with fixed tests.) Adjust wording for const-qualification mismatch to be a little more clear. Also add another diagnostic for a ref qualifier mismatch, which previously produced a useless error (this error path is simply very old; see rL119336): Before: error: cannot initialize object parameter of type 'X0' with an expression of type 'X0' After: error: 'this' argument to member function 'rvalue' is an lvalue, but function has rvalue ref-qualifier Reviewers: aaron.ballman Reviewed By: aaron.ballman Subscribers: lebedev.ri, cfe-commits Differential Revision: https://reviews.llvm.org/D41646 llvm-svn: 321609
Diffstat (limited to 'clang/test/SemaCXX/copy-initialization.cpp')
-rw-r--r--clang/test/SemaCXX/copy-initialization.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/SemaCXX/copy-initialization.cpp b/clang/test/SemaCXX/copy-initialization.cpp
index 4f6c65cf550..cd7e5f07e14 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{{'bar' not viable: 'this' argument has type 'const foo', but function is not marked const}}
+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}}
namespace PR6757 {
struct Foo {
OpenPOWER on IntegriCloud