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)
commitf9e37be2d63ea563bb235b74f7103353ec0fdfef
treefb54c3885ec7b8b6e66a0eb268ec26f2d5d6de87
parent655b59854fba05212109b63ca4cd7e40e2843917
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.

llvm-svn: 227581
clang/lib/Parse/ParseExprCXX.cpp
clang/test/Parser/cxx-class.cpp