mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-17 14:05:23 +02:00
Bug 442213 - Field reference in pack expansion
Change-Id: Iea4f20ced1050d66aad178d43db0c5dac15faed2 Signed-off-by: Nathan Ridge <zeratul976@hotmail.com> Reviewed-on: https://git.eclipse.org/r/32191 Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com> Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
This commit is contained in:
parent
60290def38
commit
01fcf452a7
2 changed files with 20 additions and 0 deletions
|
@ -8057,6 +8057,22 @@ public class AST2TemplateTests extends AST2TestBase {
|
|||
BindingAssertionHelper helper = getAssertionHelper();
|
||||
helper.assertProblem("waldo<int>()", "waldo<int>");
|
||||
}
|
||||
|
||||
// // Example 1
|
||||
// template <typename... T>
|
||||
// void foo1(T... t) {
|
||||
// bar(t.waldo...);
|
||||
// }
|
||||
//
|
||||
// // Example 2
|
||||
// template <typename> struct A {};
|
||||
// template <typename... T>
|
||||
// void foo2(A<T>... t) {
|
||||
// bar(t.waldo...);
|
||||
// }
|
||||
public void testMemberAccessInPackExpansion_442213() throws Exception {
|
||||
parseAndCheckBindings();
|
||||
}
|
||||
|
||||
// template <typename T>
|
||||
// struct A {};
|
||||
|
|
|
@ -157,6 +157,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
|||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespaceAlias;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespaceScope;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameterPackType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPReferenceType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
||||
|
@ -1301,6 +1302,9 @@ public class CPPVisitor extends ASTQueries {
|
|||
final ICPPASTFieldReference fieldReference = (ICPPASTFieldReference) parent;
|
||||
IType type = fieldReference.getFieldOwnerType();
|
||||
type= getUltimateTypeUptoPointers(type);
|
||||
if (type instanceof ICPPParameterPackType) {
|
||||
type = ((ICPPParameterPackType) type).getType();
|
||||
}
|
||||
if (type instanceof ICPPClassType) {
|
||||
type= SemanticUtil.mapToAST(type, fieldReference);
|
||||
return ((ICPPClassType) type).getCompositeScope();
|
||||
|
|
Loading…
Add table
Reference in a new issue