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

Bug 429837 - Unresolved symbol with declspec and const.

This commit is contained in:
Sergey Prigogin 2014-03-06 22:47:18 -08:00
parent f5238bf93f
commit c0e82d24a7
2 changed files with 18 additions and 1 deletions

View file

@ -8173,6 +8173,21 @@ public class AST2TemplateTests extends AST2TestBase {
assertSameType((ITypedef) helper.assertNonProblem("U<S>::type"), CommonTypes.int_);
}
// template <typename T>
// struct A {
// typedef T type;
// };
//
// struct B {
// static const A<int> c;
// };
//
// decltype(B::c)::type x;
public void testDependentDecltypeInNameQualifier_429837() throws Exception {
BindingAssertionHelper helper = getAssertionHelper();
assertSameType((ITypedef) helper.assertNonProblem("decltype(B::c)::type"), CommonTypes.int_);
}
// namespace N {
// template <typename>
// struct C;

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2013 Nathan Ridge
* Copyright (c) 2013, 2014 Nathan Ridge
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -20,6 +20,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression;
import org.eclipse.cdt.core.parser.Keywords;
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil;
/**
* Implementation of ICPPASTDecltypeSpecifier.
@ -73,6 +74,7 @@ public class CPPASTDecltypeSpecifier extends ASTNode
@Override
public IBinding resolveBinding() {
IType type = fDecltypeExpression.getExpressionType();
type = SemanticUtil.getNestedType(type, SemanticUtil.CVTYPE);
if (type instanceof IBinding)
return (IBinding) type;
return null;