[cfe-dev] TypedefDecl for injected-class-name
Argiris Kirtzidis
akyrtzi at gmail.com
Fri Nov 7 16:46:19 PST 2008
Hi Doug,
Is creating a TypedefDecl for injected-class-name really necessary ?
I think we can avoid allocating something like this, probably by using
PushOnScopeChains(Dcl, S);
where 'Dcl' is the CXXRecordDecl.
Creating a TypedefDecl doesn't "fit" well with the 'real' declarations, e.g:
class C {
static int C;
};
t.cpp:2:14: error: redefinition of 'C' as different kind of symbol
static int C;
^
t.cpp:1:9: error: previous definition is here
class C {
^
where we would like to have something like:
error: declaration of a member with the same name as its class
And the fact that
class C {
int C;
};
compiles is actually due to a bug where instance fields is not colliding
with other member declarations, like
class C {
typedef int T;
int T; // bug, no collision
};
-Argiris
More information about the cfe-dev
mailing list