1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-25 01:45:33 +02:00

Bug 466845 - Parameter pack of reference type as field owner

Change-Id: Ib1a04bbe50817db5400c70d494fd9d938458020f
Signed-off-by: Nathan Ridge <zeratul976@hotmail.com>
This commit is contained in:
Nathan Ridge 2015-05-08 09:28:42 -05:00 committed by Gerrit Code Review @ Eclipse.org
parent 76d4831878
commit 0ff408c238
2 changed files with 29 additions and 1 deletions

View file

@ -8166,6 +8166,34 @@ public class AST2TemplateTests extends AST2TestBase {
public void testMemberAccessInPackExpansion_442213() throws Exception {
parseAndCheckBindings();
}
// // 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...);
// }
//
// // Example 3
// template <typename... T>
// void foo1(T&&... t) {
// bar(t.waldo...);
// }
//
// // Example 4
// template <typename... T>
// void foo1(const T&... t) {
// bar(t.waldo...);
// }
public void testMemberAccessViaReferenceInPackExpansion_466845() throws Exception {
parseAndCheckBindings();
}
// template <typename T>
// struct A {};

View file

@ -1296,10 +1296,10 @@ public class CPPVisitor extends ASTQueries {
if (parent instanceof ICPPASTFieldReference) {
final ICPPASTFieldReference fieldReference = (ICPPASTFieldReference) parent;
IType type = fieldReference.getFieldOwnerType();
type= getUltimateTypeUptoPointers(type);
if (type instanceof ICPPParameterPackType) {
type = ((ICPPParameterPackType) type).getType();
}
type= getUltimateTypeUptoPointers(type);
if (type instanceof ICPPClassType) {
type= SemanticUtil.mapToAST(type, fieldReference);
return ((ICPPClassType) type).getCompositeScope();