mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Cosmetics.
Change-Id: Ibd8c8ac950c55c02259e9dfacb0649dfca8820dc
This commit is contained in:
parent
d69b51acc8
commit
4fa9706ea8
3 changed files with 12 additions and 43 deletions
|
@ -528,16 +528,16 @@ public class CPPVisitor extends ASTQueries {
|
|||
return binding;
|
||||
|
||||
if (binding instanceof ICPPClassType) {
|
||||
final ICPPInternalBinding ib = (ICPPInternalBinding) binding;
|
||||
ICPPInternalBinding internalBinding = (ICPPInternalBinding) binding;
|
||||
if (templateParametersMatch((ICPPClassType) binding, templateDecl)) {
|
||||
ib.addDeclaration(elabType);
|
||||
internalBinding.addDeclaration(elabType);
|
||||
return binding;
|
||||
}
|
||||
|
||||
if (CPPSemantics.declaredBefore(ib, name, false)) {
|
||||
if (CPPSemantics.declaredBefore(internalBinding, name, false)) {
|
||||
return new ProblemBinding(name, IProblemBinding.SEMANTIC_INVALID_REDECLARATION);
|
||||
}
|
||||
markRedeclaration(ib);
|
||||
markRedeclaration(internalBinding);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -614,7 +614,7 @@ public class CPPVisitor extends ASTQueries {
|
|||
return e.getProblem();
|
||||
}
|
||||
|
||||
// Can't lookup anonymous names
|
||||
// Can't lookup anonymous names.
|
||||
IBinding binding= null;
|
||||
ICPPASTTemplateDeclaration templateDecl = CPPTemplates.getTemplateDeclaration(name);
|
||||
if (name.getLookupKey().length > 0 && scope != null) {
|
||||
|
@ -622,16 +622,16 @@ public class CPPVisitor extends ASTQueries {
|
|||
|
||||
if (binding instanceof ICPPInternalBinding
|
||||
&& binding instanceof ICPPClassType && name.isActive()) {
|
||||
ICPPInternalBinding ib = (ICPPInternalBinding) binding;
|
||||
if (ib.getDefinition() == null
|
||||
ICPPInternalBinding internalBinding = (ICPPInternalBinding) binding;
|
||||
if (internalBinding.getDefinition() == null
|
||||
&& templateParametersMatch((ICPPClassType) binding, templateDecl)) {
|
||||
ASTInternal.addDefinition(ib, compType);
|
||||
ASTInternal.addDefinition(internalBinding, compType);
|
||||
return binding;
|
||||
}
|
||||
if (CPPSemantics.declaredBefore(ib, name, false)) {
|
||||
if (CPPSemantics.declaredBefore(internalBinding, name, false)) {
|
||||
return new ProblemBinding(name, IProblemBinding.SEMANTIC_INVALID_REDEFINITION);
|
||||
}
|
||||
markRedeclaration(ib);
|
||||
markRedeclaration(internalBinding);
|
||||
}
|
||||
}
|
||||
if (templateDecl != null)
|
||||
|
|
|
@ -15,8 +15,7 @@ package org.eclipse.cdt.ui.tests.text.contentassist2;
|
|||
/**
|
||||
* @author hamer
|
||||
*
|
||||
* This abstract class is the base class for all completion proposals test cases
|
||||
*
|
||||
* This abstract class is the base class for all completion proposals test cases.
|
||||
*/
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
|
@ -31,7 +30,6 @@ import org.eclipse.core.runtime.Path;
|
|||
import org.eclipse.cdt.ui.testplugin.CTestPlugin;
|
||||
|
||||
public abstract class CompletionProposalsBaseTest extends AbstractContentAssistTest {
|
||||
|
||||
private boolean fFailingTest;
|
||||
|
||||
public CompletionProposalsBaseTest(String name) {
|
||||
|
@ -42,9 +40,6 @@ public abstract class CompletionProposalsBaseTest extends AbstractContentAssistT
|
|||
super(name, isCpp);
|
||||
}
|
||||
|
||||
/*
|
||||
* @see junit.framework.TestCase#getName()
|
||||
*/
|
||||
@Override
|
||||
public String getName() {
|
||||
if (fFailingTest) {
|
||||
|
@ -53,9 +48,6 @@ public abstract class CompletionProposalsBaseTest extends AbstractContentAssistT
|
|||
return super.getName();
|
||||
}
|
||||
|
||||
/*
|
||||
* @see org.eclipse.cdt.core.testplugin.util.BaseTestCase#setExpectFailure(int)
|
||||
*/
|
||||
@Override
|
||||
public void setExpectFailure(int bugnumber) {
|
||||
super.setExpectFailure(bugnumber);
|
||||
|
|
|
@ -18,10 +18,8 @@ import junit.framework.TestSuite;
|
|||
*
|
||||
* Testing Namespace_Reference, with no prefix
|
||||
* Bug#50471 : Wrong completion kind after the "using" keyword
|
||||
*
|
||||
*/
|
||||
public class CompletionTest_NamespaceRef_NoPrefix extends CompletionProposalsBaseTest{
|
||||
|
||||
private final String fileName = "CompletionTestStart32.cpp";
|
||||
private final String fileFullPath ="resources/contentassist/" + fileName;
|
||||
private final String headerFileName = "CompletionTestStart.h";
|
||||
|
@ -43,59 +41,38 @@ public class CompletionTest_NamespaceRef_NoPrefix extends CompletionProposalsBa
|
|||
return suite;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getCompletionPosition()
|
||||
*/
|
||||
@Override
|
||||
protected int getCompletionPosition() {
|
||||
return getBuffer().indexOf("namespace ") + 10;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedPrefix()
|
||||
*/
|
||||
@Override
|
||||
protected String getExpectedPrefix() {
|
||||
return expectedPrefix;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getExpectedResultsValues()
|
||||
*/
|
||||
@Override
|
||||
protected String[] getExpectedResultsValues() {
|
||||
return expectedResults;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getFileName()
|
||||
*/
|
||||
@Override
|
||||
protected String getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getFileFullPath()
|
||||
*/
|
||||
@Override
|
||||
protected String getFileFullPath() {
|
||||
return fileFullPath;
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getHeaderFileFullPath()
|
||||
*/
|
||||
|
||||
@Override
|
||||
protected String getHeaderFileFullPath() {
|
||||
return headerFileFullPath;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.codeassist.tests.CompletionProposalsTest#getHeaderFileName()
|
||||
*/
|
||||
@Override
|
||||
protected String getHeaderFileName() {
|
||||
return headerFileName;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue