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:
parent
eedb362a66
commit
f208496afe
2 changed files with 16 additions and 6 deletions
|
@ -9246,4 +9246,12 @@ public class AST2CPPTests extends AST2BaseTest {
|
|||
assertSame(f2, ref);
|
||||
}
|
||||
|
||||
// struct S {
|
||||
// class C {};
|
||||
// };
|
||||
// typedef const S T;
|
||||
// T::C c;
|
||||
public void testCVQualifiedClassName_328063() throws Exception {
|
||||
parseAndCheckBindings();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue