[Sema] Improve the error diagnostic for dot destructor calls on pointer objects
authorAlex Lorenz <arphaman@gmail.com>
Fri, 20 Jan 2017 15:38:58 +0000 (15:38 +0000)
committerAlex Lorenz <arphaman@gmail.com>
Fri, 20 Jan 2017 15:38:58 +0000 (15:38 +0000)
commit56fb6fef50070d92d3137bcf912580f607e465b8
treecd2e93513cebbef16d9e24a647a487f030f83a53
parent94b999b9df15661742fdce96e14ea694f3b8f9a5
[Sema] Improve the error diagnostic for dot destructor calls on pointer objects

This commit improves the mismatched destructor type error by detecting when the
destructor call has used a '.' instead of a '->' on a pointer to the destructed
type. The diagnostic now suggests to use '->' instead of '.', and adds a fixit
where appropriate.

rdar://28766702

Differential Revision: https://reviews.llvm.org/D25817

llvm-svn: 292615
clang/lib/Sema/SemaExprCXX.cpp
clang/test/CXX/special/class.dtor/p10-0x.cpp
clang/test/FixIt/fixit.cpp
clang/test/FixIt/no-fixit.cpp
clang/test/SemaCXX/pseudo-destructors.cpp