]> granicus.if.org Git - clang/commit
[ms-cxxabi] Don't do destructor check on declarations if the dtor is deleted
authorHans Wennborg <hans@hanshq.net>
Tue, 17 Dec 2013 17:49:22 +0000 (17:49 +0000)
committerHans Wennborg <hans@hanshq.net>
Tue, 17 Dec 2013 17:49:22 +0000 (17:49 +0000)
commit9c80cbccfa6acbe80add5e4eb139c28c5b649219
treeae9b2969385e89a72f1ca2fb75caea18e8b0b65f
parentf4cc791befbca874331de1ec2bf6a925ff7e0b70
[ms-cxxabi] Don't do destructor check on declarations if the dtor is deleted

We would previously emit redundant diagnostics for the following code:

  struct S {
    virtual ~S() = delete;
    void operator delete(void*, int);
    void operator delete(void*, double);
  } s;

First we would check on ~S() and error about the ambigous delete functions,
and then we would error about using the deleted destructor.

If the destructor is deleted, there's no need to check it.

Also, move the check from Sema::ActOnFields to CheckCompleteCXXClass. These
are run at almost the same time, called from ActOnFinishCXXMemberSpecification.
However, CHeckCompleteCXXClass may mark a defaulted destructor as deleted, and
if that's the case we don't want to check it.

Differential Revision: http://llvm-reviews.chandlerc.com/D2421

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197509 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaDecl.cpp
lib/Sema/SemaDeclCXX.cpp
test/SemaCXX/microsoft-dtor-lookup-cxx11.cpp [new file with mode: 0644]