mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Bug 485806 - Name resolution problem with a parameter pack
Change-Id: I41aa69fd2f8bdc5a450ed941146de03e49590a90
This commit is contained in:
parent
751b2e3e1d
commit
df4865a9d3
2 changed files with 26 additions and 0 deletions
|
@ -8189,6 +8189,28 @@ public class AST2TemplateTests extends AST2TestBase {
|
|||
parseAndCheckBindings();
|
||||
}
|
||||
|
||||
// template <int... Is> struct A {
|
||||
// typedef A t;
|
||||
// };
|
||||
//
|
||||
// template <class P, int I> struct B;
|
||||
//
|
||||
// template <int... Is, int I>
|
||||
// struct B<A<Is...>, I> : A<Is..., I> {};
|
||||
//
|
||||
// template <typename, typename = void>
|
||||
// struct prober {};
|
||||
//
|
||||
// template <typename T>
|
||||
// struct prober<A<0>, T> {
|
||||
// typedef T t;
|
||||
// };
|
||||
//
|
||||
// prober<B<A<>, 0>::t>::t g();
|
||||
public void testParameterPack_485806() throws Exception {
|
||||
parseAndCheckBindings();
|
||||
}
|
||||
|
||||
// template <typename... Args>
|
||||
// void waldo(Args...);
|
||||
//
|
||||
|
|
|
@ -19,6 +19,7 @@ import org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory;
|
|||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||
import org.eclipse.cdt.core.dom.ast.IType;
|
||||
import org.eclipse.cdt.core.dom.ast.IValue;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameterPackType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameterMap;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTypeSpecialization;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.ISerializableEvaluation;
|
||||
|
@ -182,6 +183,9 @@ public class EvalFixed extends CPPEvaluation {
|
|||
// propagate that error.
|
||||
if (value == Value.ERROR)
|
||||
return EvalFixed.INCOMPLETE;
|
||||
// Resolve the parameter pack type to the underlying type if the instantiated value is not dependent.
|
||||
if (type instanceof ICPPParameterPackType && value.numericalValue() != null)
|
||||
type = ((ICPPParameterPackType) type).getType();
|
||||
return new EvalFixed(type, fValueCategory, value);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue