[PATCH] Avoid redundant NNS qualification in constructor/destructor names.

Please find attached a patch that improves AST representation by
removing redundant name qualifications from C++ constructor/destructor
names used inside Decl and/or Expr nodes.

The rationale of the patch is that the mentioned name qualifications
really belong to the enclosing Decl/Expr nodes and should not be
replicated in the ctor/dtor name itself.

As the patch is only affecting the syntactic aspects of the AST
representation, its application affects no existing testcase.
In order to see the effects of the patch, one can compare the output
obtained by clang using command

    $ clang -cc1 -ast-print ctor-dtor-name.cc

Before the patch (r147790), we obtain the following output (only showing
relevant parts):
// Bad: ctor-name is ElaboratedType.
inline N::struct A::A() {
// Bad: dtor-name is ElaboratedType.

After applying the patch, we obtain:
// Good: ctor-name is bare Record
// (qualifier "N::a::" is stored in the CXXConstructorDecl
// and not shown just due to pretty printer)
inline A() {
// Good: dtor-name is TemplateSpecializationType
// (qualifier "A<int>::" is stored in MemberExpr node)

OK to commit?


CtorDtorName.patch (10.2 KB)

ctor-dtor-name.cc (221 Bytes)


If there are no objections to the patch recalled here below, we will
commit it.


In r149124.