1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42: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

@ -9245,5 +9245,13 @@ public class AST2CPPTests extends AST2BaseTest {
ref= bh.assertNonProblem("f(&number)", 1);
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
// as a parent of an unknown type used as parameter type.
IBinding binding = names[i - 1].resolvePreBinding();
while (binding instanceof ITypedef) {
IType t = ((ITypedef) binding).getType();
if (t instanceof IBinding)
binding = (IBinding) t;
else break;
// 7.1.3-7 Unwrap typedefs, delete cv-qualifiers.
if (binding instanceof ITypedef) {
IType type= getNestedType((ITypedef) binding, TDEF | CVTYPE);
if (type instanceof IBinding) {
binding= (IBinding) type;
}
}
boolean done= true;
IScope scope= null;