Missing NNS qualification in ElaboratedType.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Missing NNS qualification in ElaboratedType.

Enea Zaffanella
Hello.

In the generated AST for the following program fragment:
/*==========================*/
namespace N {
   struct S {};
}

N::S s1;
struct N::S s2;
/*==========================*/

the global variable 's1' has QualifiedNameType (as expected).
In contrast, the global variable 's2' has ElaboratedType (good, so far)
that contains a plain CXXRecordType (bad, the NNS qualification is missing).

The attached simple patch fixes this problem by making sure that the
ElaboratedType will contain a QualifiedNameType. The patch also changes
the expected output of a single test, since the generated diagnostic now
contains a NNS qualification.

Cheers,
Enea Zaffanella.

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

Elaborated_Qualified.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Missing NNS qualification in ElaboratedType.

Douglas Gregor

On Apr 22, 2010, at 1:34 AM, Enea Zaffanella wrote:

> Hello.
>
> In the generated AST for the following program fragment:
> /*==========================*/
> namespace N {
>  struct S {};
> }
>
> N::S s1;
> struct N::S s2;
> /*==========================*/
>
> the global variable 's1' has QualifiedNameType (as expected).
> In contrast, the global variable 's2' has ElaboratedType (good, so far) that contains a plain CXXRecordType (bad, the NNS qualification is missing).
>
> The attached simple patch fixes this problem by making sure that the ElaboratedType will contain a QualifiedNameType. The patch also changes the expected output of a single test, since the generated diagnostic now contains a NNS qualification.


Good catch, thanks! Committed as r102065.

        - Doug
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev