]> granicus.if.org Git - clang/commit
Follow-up to r217302 and r227555: Don't crash on inline ~A::A() if A is an int.
authorNico Weber <nicolasweber@gmx.de>
Fri, 30 Jan 2015 16:53:11 +0000 (16:53 +0000)
committerNico Weber <nicolasweber@gmx.de>
Fri, 30 Jan 2015 16:53:11 +0000 (16:53 +0000)
commitd2a265184cd366af3349b70d1e9d110dc3b7834e
tree4e033fc349c14c5207a850f67292137429c2892a
parent66b6cda587eeff7ab2bdcac3c53a09279b2a2e3f
Follow-up to r217302 and r227555: Don't crash on inline ~A::A() if A is an int.

Even with r227555, this still crashed:

  struct S {
    int A;
    ~A::A() {}
  };

That's because ParseOptionalCXXScopeSpecifier()'s call to
ActOnCXXNestedNameSpecifier() doesn't mark the scope spec as invalid if sema
thought it's a good idea to fixit-correct "::" to ":".  For the diagnostic
improvement done in r217302, we never want :: to be interpreted as :, so fix
this by setting ColonSacred to false temporarily.

Found by SLi's bot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227581 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Parse/ParseExprCXX.cpp
test/Parser/cxx-class.cpp