]> granicus.if.org Git - clang/commit
[Sema] Improve diagnostics for const- and ref-qualified member functions
authorJacob Bandes-Storch <jacob@bandes-stor.ch>
Sun, 31 Dec 2017 18:27:29 +0000 (18:27 +0000)
committerJacob Bandes-Storch <jacob@bandes-stor.ch>
Sun, 31 Dec 2017 18:27:29 +0000 (18:27 +0000)
commit7a65af2a3afadd2ed099e9fa839ea0ac746933b4
tree7d42b4e238627fc67e8dee298b276ce0fdf26169
parent352a8a419d7c9515bd05787c0390238f609cd4ae
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321609 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaOverload.cpp
test/CXX/over/over.match/over.match.funcs/p4-0x.cpp
test/CXX/stmt.stmt/stmt.iter/stmt.ranged/p1.cpp
test/SemaCXX/copy-initialization.cpp
test/SemaCXX/cxx1y-contextual-conversion-tweaks.cpp
test/SemaCXX/cxx2a-pointer-to-const-ref-member.cpp