diff options
author | Jacob Bandes-Storch <jacob@bandes-stor.ch> | 2017-12-31 04:49:39 +0000 |
---|---|---|
committer | Jacob Bandes-Storch <jacob@bandes-stor.ch> | 2017-12-31 04:49:39 +0000 |
commit | e006e0409cc387a371e7a22c1ef84b3048a7deed (patch) | |
tree | 9da64e2b17314b4e875818054063224ddbcd186e /test/SemaCXX | |
parent | 2d075f470bfbcf5d146dca41b90374e32fc42278 (diff) |
[Sema] Improve diagnostics for const- and ref-qualified member functions
Summary:
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: rsmith, aaron.ballman
Reviewed By: aaron.ballman
Subscribers: lebedev.ri, aaron.ballman, cfe-commits
Differential Revision: https://reviews.llvm.org/D39937
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321592 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX')
-rw-r--r-- | test/SemaCXX/copy-initialization.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/SemaCXX/copy-initialization.cpp b/test/SemaCXX/copy-initialization.cpp index 4f6c65cf55..cd7e5f07e1 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{{'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 { |