mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Bug 448785 - Name resolution problem with nested alias template
This commit is contained in:
parent
e437230f58
commit
078541c956
2 changed files with 29 additions and 2 deletions
|
@ -7054,6 +7054,31 @@ public class AST2TemplateTests extends AST2TestBase {
|
|||
assertSameType(tRef.getTemplateParameterMap().getArgument(0).getTypeValue(), Sint);
|
||||
}
|
||||
|
||||
// template <typename T>
|
||||
// struct A {
|
||||
// typedef void (T::*func)();
|
||||
// };
|
||||
//
|
||||
// template <typename T>
|
||||
// struct B {
|
||||
// template <typename A<T>::func U>
|
||||
// class C {};
|
||||
//
|
||||
// template <typename A<T>::func U>
|
||||
// using Waldo = C<U>;
|
||||
// };
|
||||
//
|
||||
// struct D {
|
||||
// void m();
|
||||
// };
|
||||
//
|
||||
// void test() {
|
||||
// B<D>::Waldo<&D::m>();
|
||||
// }
|
||||
public void testTemplatedAliasWithPointerToMember_448785() throws Exception {
|
||||
parseAndCheckBindings();
|
||||
}
|
||||
|
||||
// namespace NS {
|
||||
// template<typename T>
|
||||
// struct S {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2011 Wind River Systems, Inc. and others.
|
||||
* Copyright (c) 2011, 2014 Wind River Systems, Inc. and others.
|
||||
* 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
|
||||
|
@ -7,6 +7,7 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Markus Schorn - initial API and implementation
|
||||
* Sergey Prigogin (Google)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||
|
||||
|
@ -22,6 +23,7 @@ import org.eclipse.cdt.core.dom.ast.IBinding;
|
|||
import org.eclipse.cdt.core.dom.ast.IFunction;
|
||||
import org.eclipse.cdt.core.dom.ast.IProblemBinding;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPAliasTemplateInstance;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
|
||||
|
@ -117,7 +119,7 @@ public class CPPASTTemplateIDAmbiguity extends ASTAmbiguousNode
|
|||
return -1;
|
||||
count++;
|
||||
} else if (b instanceof ICPPSpecialization || b instanceof ICPPTemplateDefinition
|
||||
|| b instanceof ICPPConstructor
|
||||
|| b instanceof ICPPAliasTemplateInstance || b instanceof ICPPConstructor
|
||||
|| (b instanceof IFunction && b instanceof ICPPUnknownBinding)) {
|
||||
count++;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue