mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Bug 377223 - Name resolution problem caused by a const qualifier in
template parameter
This commit is contained in:
parent
c4b91212b3
commit
c1066f1e4a
2 changed files with 5 additions and 1 deletions
|
@ -5812,7 +5812,7 @@ public class AST2TemplateTests extends AST2BaseTest {
|
|||
//};
|
||||
//
|
||||
//B<const A> a(&A::m);
|
||||
public void _testConstInTypeParameter_377223() throws Exception {
|
||||
public void testConstInTypeParameter_377223() throws Exception {
|
||||
parseAndCheckBindings();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ import org.eclipse.cdt.core.dom.ast.IEnumerator;
|
|||
import org.eclipse.cdt.core.dom.ast.IFunction;
|
||||
import org.eclipse.cdt.core.dom.ast.IFunctionType;
|
||||
import org.eclipse.cdt.core.dom.ast.IProblemBinding;
|
||||
import org.eclipse.cdt.core.dom.ast.IQualifierType;
|
||||
import org.eclipse.cdt.core.dom.ast.IScope;
|
||||
import org.eclipse.cdt.core.dom.ast.ISemanticProblem;
|
||||
import org.eclipse.cdt.core.dom.ast.IType;
|
||||
|
@ -1190,6 +1191,9 @@ public class CPPTemplates {
|
|||
ICPPPointerToMemberType ptm = (ICPPPointerToMemberType) typeContainer;
|
||||
IType memberOfClass = ptm.getMemberOfClass();
|
||||
IType newMemberOfClass = instantiateType(memberOfClass, tpMap, packOffset, within);
|
||||
if (newMemberOfClass instanceof IQualifierType) {
|
||||
newMemberOfClass = ((IQualifierType) newMemberOfClass).getType();
|
||||
}
|
||||
if (!(newMemberOfClass instanceof ICPPClassType || newMemberOfClass instanceof UniqueType
|
||||
|| newMemberOfClass instanceof ICPPUnknownBinding)) {
|
||||
return new ProblemType(ISemanticProblem.BINDING_INVALID_TYPE);
|
||||
|
|
Loading…
Add table
Reference in a new issue