mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 01:15:29 +02:00
Cosmetics.
This commit is contained in:
parent
4fafaeaf10
commit
50151f0a71
6 changed files with 28 additions and 26 deletions
|
@ -7486,7 +7486,7 @@ public class AST2CPPTests extends AST2TestBase {
|
|||
// void f(int const volatile * const *) {}
|
||||
// void test() {
|
||||
// int ** x;
|
||||
// f(x); // problem binding here
|
||||
// f(x);
|
||||
// }
|
||||
public void testRankingOfQualificationConversion_269321() throws Exception {
|
||||
final String code = getAboveComment();
|
||||
|
@ -7601,8 +7601,8 @@ public class AST2CPPTests extends AST2TestBase {
|
|||
// void xx() {
|
||||
// D d1;
|
||||
// const D d2= D();
|
||||
// test(d1); // problem binding here although test(C c) has to be selected
|
||||
// test(d2); // problem binding here although test(C c) has to be selected
|
||||
// test(d1); // test(C c) has to be selected
|
||||
// test(d2); // test(C c) has to be selected
|
||||
// }
|
||||
public void testDerivedToBaseConversion_269318() throws Exception {
|
||||
final String code = getAboveComment();
|
||||
|
@ -7626,7 +7626,7 @@ public class AST2CPPTests extends AST2TestBase {
|
|||
// operator fp() { return foo; }
|
||||
// } a;
|
||||
//
|
||||
// int i = bar(a(1)); // problem on bar
|
||||
// int i = bar(a(1));
|
||||
public void testCallToObjectOfClassType_267389() throws Exception {
|
||||
final String code = getAboveComment();
|
||||
parseAndCheckBindings(code, CPP);
|
||||
|
|
|
@ -3625,7 +3625,7 @@ public class AST2TemplateTests extends AST2TestBase {
|
|||
// template<> class A<float> {
|
||||
// template<typename T> void f(T);
|
||||
// };
|
||||
// template<typename T> void A<float>::f(T){} //problem on f
|
||||
// template<typename T> void A<float>::f(T){}
|
||||
public void testClassTemplateMemberFunctionTemplate_104262() throws Exception {
|
||||
final String code = getAboveComment();
|
||||
parseAndCheckBindings(code);
|
||||
|
@ -7594,7 +7594,7 @@ public class AST2TemplateTests extends AST2TestBase {
|
|||
// template <class T> void waldo(function f);
|
||||
//
|
||||
// void test() {
|
||||
// waldo<A>(""); // problem on waldo
|
||||
// waldo<A>("");
|
||||
// }
|
||||
public void testSfinaeInIdExpression_459940() throws Exception {
|
||||
parseAndCheckBindings();
|
||||
|
@ -7951,7 +7951,7 @@ public class AST2TemplateTests extends AST2TestBase {
|
|||
// template <class T> void waldo(function<T()> generator);
|
||||
//
|
||||
// void test() {
|
||||
// waldo<A>(""); // problem on waldo
|
||||
// waldo<A>("");
|
||||
// }
|
||||
public void testPackExpansionInNestedTemplate_459844() throws Exception {
|
||||
parseAndCheckBindings();
|
||||
|
@ -8295,7 +8295,7 @@ public class AST2TemplateTests extends AST2TestBase {
|
|||
//
|
||||
// void test() {
|
||||
// A a;
|
||||
// waldo(a, C<>()); // problem on waldo
|
||||
// waldo(a, C<>());
|
||||
// }
|
||||
public void testDecltypeInPackExpansion_486425a() throws Exception {
|
||||
parseAndCheckBindings();
|
||||
|
@ -8317,7 +8317,7 @@ public class AST2TemplateTests extends AST2TestBase {
|
|||
//
|
||||
// void test() {
|
||||
// A a;
|
||||
// waldo(a, C<>()); // problem on waldo
|
||||
// waldo(a, C<>());
|
||||
// }
|
||||
public void testDecltypeInPackExpansion_486425b() throws Exception {
|
||||
parseAndCheckBindings();
|
||||
|
@ -8768,13 +8768,13 @@ public class AST2TemplateTests extends AST2TestBase {
|
|||
// }
|
||||
//
|
||||
// template <typename T>
|
||||
// typename enable_if<!F<T>(), void>::type waldo(T p); // problem on the return type
|
||||
// typename enable_if<!F<T>(), void>::type waldo(T p);
|
||||
//
|
||||
// struct A {};
|
||||
//
|
||||
// void test() {
|
||||
// A a;
|
||||
// waldo(a); // problem on waldo
|
||||
// waldo(a);
|
||||
// }
|
||||
public void testDependentFunctionSet_485985() throws Exception {
|
||||
parseAndCheckBindings();
|
||||
|
@ -8835,7 +8835,7 @@ public class AST2TemplateTests extends AST2TestBase {
|
|||
// A<int>::B d;
|
||||
//
|
||||
// void test() {
|
||||
// waldo(foo(c, d)); // problem on waldo
|
||||
// waldo(foo(c, d));
|
||||
// }
|
||||
public void testInstantiationOfFriendOfNestedClassInsideTemplate_484162() throws Exception {
|
||||
parseAndCheckBindings();
|
||||
|
|
|
@ -22,7 +22,7 @@ import org.eclipse.cdt.internal.core.dom.parser.ProblemBinding;
|
|||
import org.eclipse.core.runtime.CoreException;
|
||||
|
||||
public class CPPParameterPackType implements ICPPParameterPackType, ITypeContainer, ISerializableType {
|
||||
private IType fType = null;
|
||||
private IType fType;
|
||||
|
||||
public CPPParameterPackType(IType type) {
|
||||
setType(type);
|
||||
|
@ -44,7 +44,7 @@ public class CPPParameterPackType implements ICPPParameterPackType, ITypeContain
|
|||
if (obj == this)
|
||||
return true;
|
||||
if (obj instanceof ITypedef)
|
||||
return ((ITypedef)obj).isSameType(this);
|
||||
return ((ITypedef) obj).isSameType(this);
|
||||
|
||||
if (obj instanceof ICPPParameterPackType) {
|
||||
final ICPPParameterPackType rhs = (ICPPParameterPackType) obj;
|
||||
|
@ -60,7 +60,7 @@ public class CPPParameterPackType implements ICPPParameterPackType, ITypeContain
|
|||
try {
|
||||
return super.clone();
|
||||
} catch (CloneNotSupportedException e) {
|
||||
// not going to happen
|
||||
// Not going to happen.
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1121,7 +1121,7 @@ public class CPPTemplates {
|
|||
return determinePackSize((ICPPTemplateParameter) type, tpMap);
|
||||
}
|
||||
|
||||
if (type instanceof TypeOfDependentExpression){
|
||||
if (type instanceof TypeOfDependentExpression) {
|
||||
return ((TypeOfDependentExpression) type).getEvaluation().determinePackSize(tpMap);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@ import org.eclipse.core.runtime.CoreException;
|
|||
* Evaluation for a pack expansion expression.
|
||||
*/
|
||||
public class EvalParameterPack extends CPPDependentEvaluation {
|
||||
|
||||
private ICPPEvaluation fExpansionPattern;
|
||||
private IType fType;
|
||||
|
||||
|
|
|
@ -165,7 +165,7 @@ public class TemplateArgumentDeduction {
|
|||
|
||||
// Do trial deduction
|
||||
CPPTemplateParameterMap success= null;
|
||||
Set<String> handled= new HashSet<String>();
|
||||
Set<String> handled= new HashSet<>();
|
||||
for (ICPPFunction f : fs) {
|
||||
arg= f.getType();
|
||||
if (f instanceof ICPPMethod && !f.isStatic()) {
|
||||
|
@ -331,7 +331,8 @@ public class TemplateArgumentDeduction {
|
|||
|
||||
boolean isDependentPar= CPPTemplates.isDependentType(par);
|
||||
if (isDependentPar) {
|
||||
TemplateArgumentDeduction deduct= new TemplateArgumentDeduction(tmplParams, map, new CPPTemplateParameterMap(tmplParams.length), 0);
|
||||
TemplateArgumentDeduction deduct=
|
||||
new TemplateArgumentDeduction(tmplParams, map, new CPPTemplateParameterMap(tmplParams.length), 0);
|
||||
par= SemanticUtil.getNestedType(par, SemanticUtil.TDEF);
|
||||
if (arg != null && !deduct.fromType(par, arg, false, point))
|
||||
return null;
|
||||
|
@ -401,7 +402,8 @@ public class TemplateArgumentDeduction {
|
|||
if (!SemanticUtil.isValidType(p))
|
||||
return null;
|
||||
|
||||
TemplateArgumentDeduction deduct= new TemplateArgumentDeduction(tmplParams, map, new CPPTemplateParameterMap(tmplParams.length), 0);
|
||||
TemplateArgumentDeduction deduct=
|
||||
new TemplateArgumentDeduction(tmplParams, map, new CPPTemplateParameterMap(tmplParams.length), 0);
|
||||
if (!deduct.fromType(p, a, false, point)) {
|
||||
return null;
|
||||
}
|
||||
|
@ -428,9 +430,10 @@ public class TemplateArgumentDeduction {
|
|||
final int fnParCount = fnPars.length;
|
||||
final int fnArgCount = fnArgs.length;
|
||||
int result= 0;
|
||||
TemplateArgumentDeduction deduct= new TemplateArgumentDeduction(tmplPars, new CPPTemplateParameterMap(0), new CPPTemplateParameterMap(fnParCount), 0);
|
||||
TemplateArgumentDeduction deduct=
|
||||
new TemplateArgumentDeduction(tmplPars, new CPPTemplateParameterMap(0), new CPPTemplateParameterMap(fnParCount), 0);
|
||||
IType fnParPack= null;
|
||||
Set<Integer> usedTemplateParIds= new HashSet<Integer>();
|
||||
Set<Integer> usedTemplateParIds= new HashSet<>();
|
||||
for (int j= 0; j < fnArgCount; j++) {
|
||||
IType par;
|
||||
if (fnParPack != null) {
|
||||
|
@ -598,7 +601,7 @@ public class TemplateArgumentDeduction {
|
|||
|
||||
private static ICPPTemplateArgument[] createArguments(CPPTemplateParameterMap map,
|
||||
final ICPPTemplateParameter[] tmplParams) {
|
||||
List<ICPPTemplateArgument> result= new ArrayList<ICPPTemplateArgument>(tmplParams.length);
|
||||
List<ICPPTemplateArgument> result= new ArrayList<>(tmplParams.length);
|
||||
for (ICPPTemplateParameter tpar : tmplParams) {
|
||||
if (tpar.isParameterPack()) {
|
||||
ICPPTemplateArgument[] deducedArgs= map.getPackExpansion(tpar);
|
||||
|
@ -622,7 +625,7 @@ public class TemplateArgumentDeduction {
|
|||
* the deduced A.
|
||||
*/
|
||||
private static ICPPClassType findBaseInstance(ICPPClassType a, ICPPClassTemplate pTemplate, IASTNode point) throws DOMException {
|
||||
return findBaseInstance(a, pTemplate, CPPSemantics.MAX_INHERITANCE_DEPTH, new HashSet<Object>(), point);
|
||||
return findBaseInstance(a, pTemplate, CPPSemantics.MAX_INHERITANCE_DEPTH, new HashSet<>(), point);
|
||||
}
|
||||
|
||||
private static ICPPClassType findBaseInstance(ICPPClassType a, ICPPClassTemplate pTemplate, int maxdepth, HashSet<Object> handled, IASTNode point) throws DOMException {
|
||||
|
@ -769,7 +772,7 @@ public class TemplateArgumentDeduction {
|
|||
for (ICPPTemplateParameter tpar : tpars) {
|
||||
if (tpar.isParameterPack()) {
|
||||
if (fTemplateParameterPacks == null) {
|
||||
fTemplateParameterPacks= new HashSet<Integer>();
|
||||
fTemplateParameterPacks= new HashSet<>();
|
||||
}
|
||||
fTemplateParameterPacks.add(tpar.getParameterID());
|
||||
}
|
||||
|
@ -999,7 +1002,7 @@ public class TemplateArgumentDeduction {
|
|||
p= pArgs[i];
|
||||
if (p.isPackExpansion()) {
|
||||
p= expansionPattern= p.getExpansionPattern();
|
||||
deduct= new TemplateArgumentDeduction(this, aArgs.length-i);
|
||||
deduct= new TemplateArgumentDeduction(this, aArgs.length - i);
|
||||
p= CPPTemplates.instantiateArgument(p, fExplicitArgs, deduct.fPackOffset, null, point);
|
||||
if (!CPPTemplates.isValidArgument(p))
|
||||
return false;
|
||||
|
|
Loading…
Add table
Reference in a new issue