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

Enea Zaffanella zaffanella at cs.unipr.it
Wed Jan 18 09:50:58 PST 2012


Ping.

Il 13/01/2012 15:35, Enea Zaffanella ha scritto:
> 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.
>     q->A<int>::~A<int>::A<int>();
> 
> 
> 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)
>     q->A<int>::~A<int>();
> 
> 
> 
> OK to commit?
> 
> Enea.
> 
> 
> 
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list