mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 02:06:01 +02:00
Bug 429837 - Unresolved symbol with declspec and const.
This commit is contained in:
parent
f5238bf93f
commit
c0e82d24a7
2 changed files with 18 additions and 1 deletions
|
@ -8173,6 +8173,21 @@ public class AST2TemplateTests extends AST2TestBase {
|
||||||
assertSameType((ITypedef) helper.assertNonProblem("U<S>::type"), CommonTypes.int_);
|
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 {
|
// namespace N {
|
||||||
// template <typename>
|
// template <typename>
|
||||||
// struct C;
|
// struct C;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2013 Nathan Ridge
|
* Copyright (c) 2013, 2014 Nathan Ridge
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* 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.core.parser.Keywords;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
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.IASTAmbiguityParent;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of ICPPASTDecltypeSpecifier.
|
* Implementation of ICPPASTDecltypeSpecifier.
|
||||||
|
@ -73,6 +74,7 @@ public class CPPASTDecltypeSpecifier extends ASTNode
|
||||||
@Override
|
@Override
|
||||||
public IBinding resolveBinding() {
|
public IBinding resolveBinding() {
|
||||||
IType type = fDecltypeExpression.getExpressionType();
|
IType type = fDecltypeExpression.getExpressionType();
|
||||||
|
type = SemanticUtil.getNestedType(type, SemanticUtil.CVTYPE);
|
||||||
if (type instanceof IBinding)
|
if (type instanceof IBinding)
|
||||||
return (IBinding) type;
|
return (IBinding) type;
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Add table
Reference in a new issue