mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
Bug 422505 - Additional fix for unqualified case
Change-Id: Ia2a154c789d1b46643a67958611589e900ae0f18 Signed-off-by: Nathan Ridge <zeratul976@hotmail.com> Reviewed-on: https://git.eclipse.org/r/19826 Tested-by: Hudson CI Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com> IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com> Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
This commit is contained in:
parent
7f3095be51
commit
d96ec1dfc8
2 changed files with 19 additions and 2 deletions
|
@ -76,6 +76,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate;
|
|||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplatePartialSpecialization;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDeferredFunction;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
|
||||
|
@ -8177,7 +8178,22 @@ public class AST2TemplateTests extends AST2TestBase {
|
|||
// class A {
|
||||
// friend int ns::waldo<T>(const A<T>&);
|
||||
// };
|
||||
public void testDependentSpecializationOfFunctionTemplateAsFriend_422505() throws Exception {
|
||||
public void testDependentSpecializationOfFunctionTemplateAsFriend_422505a() throws Exception {
|
||||
parseAndCheckBindings();
|
||||
}
|
||||
|
||||
// template <typename T>
|
||||
// class A;
|
||||
//
|
||||
// template <typename T>
|
||||
// int waldo(const A<T>&);
|
||||
//
|
||||
// template <typename T>
|
||||
// class A {
|
||||
// friend int waldo<T>(const A<T>&);
|
||||
// };
|
||||
public void testDependentSpecializationOfFunctionTemplateAsFriend_422505b() throws Exception {
|
||||
BindingAssertionHelper helper = getAssertionHelper();
|
||||
helper.assertNonProblem("waldo<T>", ICPPDeferredFunction.class);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -146,6 +146,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
|
|||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPDeferredFunction;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPEnumeration;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionScope;
|
||||
|
@ -849,7 +850,7 @@ public class CPPVisitor extends ASTQueries {
|
|||
if (isFunction) {
|
||||
if (binding instanceof ICPPInternalBinding && binding instanceof ICPPFunction && name.isActive()) {
|
||||
ICPPFunction function = (ICPPFunction) binding;
|
||||
boolean sameFunction = CPPSemantics.isSameFunction(function, typeRelevantDtor);
|
||||
boolean sameFunction = CPPSemantics.isSameFunction(function, typeRelevantDtor) || function instanceof ICPPDeferredFunction;
|
||||
if (function.getOwner() instanceof ICPPClassType) {
|
||||
// Don't consider a function brought into scope from a base class scope
|
||||
// to be the same as a function declared in a derived class scope.
|
||||
|
|
Loading…
Add table
Reference in a new issue