1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Bug 328063: Typedef to cv-qualified class as class-name.

This commit is contained in:
Markus Schorn 2010-10-20 14:29:46 +00:00
parent eedb362a66
commit f208496afe
2 changed files with 16 additions and 6 deletions

View file

@ -9246,4 +9246,12 @@ public class AST2CPPTests extends AST2BaseTest {
assertSame(f2, ref); assertSame(f2, ref);
} }
// struct S {
// class C {};
// };
// typedef const S T;
// T::C c;
public void testCVQualifiedClassName_328063() throws Exception {
parseAndCheckBindings();
}
} }

View file

@ -1048,11 +1048,13 @@ public class CPPVisitor extends ASTQueries {
// For template functions we may need to resolve a template parameter // For template functions we may need to resolve a template parameter
// as a parent of an unknown type used as parameter type. // as a parent of an unknown type used as parameter type.
IBinding binding = names[i - 1].resolvePreBinding(); IBinding binding = names[i - 1].resolvePreBinding();
while (binding instanceof ITypedef) {
IType t = ((ITypedef) binding).getType(); // 7.1.3-7 Unwrap typedefs, delete cv-qualifiers.
if (t instanceof IBinding) if (binding instanceof ITypedef) {
binding = (IBinding) t; IType type= getNestedType((ITypedef) binding, TDEF | CVTYPE);
else break; if (type instanceof IBinding) {
binding= (IBinding) type;
}
} }
boolean done= true; boolean done= true;
IScope scope= null; IScope scope= null;