mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Cosmetics.
This commit is contained in:
parent
785c675364
commit
dfd1d0d635
2 changed files with 13 additions and 15 deletions
|
@ -6085,7 +6085,7 @@ public class AST2TemplateTests extends AST2BaseTest {
|
||||||
public void testIsPOD_367993() throws Exception {
|
public void testIsPOD_367993() throws Exception {
|
||||||
parseAndCheckBindings(getAboveComment(), CPP, true);
|
parseAndCheckBindings(getAboveComment(), CPP, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// template<typename T, void (T::*M)()> class A {
|
// template<typename T, void (T::*M)()> class A {
|
||||||
// public:
|
// public:
|
||||||
// static void Delegate(void* thiz) { ((T*)thiz->*M)(); }
|
// static void Delegate(void* thiz) { ((T*)thiz->*M)(); }
|
||||||
|
@ -6108,7 +6108,7 @@ public class AST2TemplateTests extends AST2BaseTest {
|
||||||
public void testDeductionOfNonTypeTemplateArg_372587() throws Exception {
|
public void testDeductionOfNonTypeTemplateArg_372587() throws Exception {
|
||||||
parseAndCheckBindings(getAboveComment(), CPP, true);
|
parseAndCheckBindings(getAboveComment(), CPP, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// template<typename _Functor> void b(_Functor __f) {}
|
// template<typename _Functor> void b(_Functor __f) {}
|
||||||
// template<typename T, typename V> void f(T __first, T __last, const V& __val) {}
|
// template<typename T, typename V> void f(T __first, T __last, const V& __val) {}
|
||||||
// template<typename T> void f(T __first, T __last, const T& __val) {}
|
// template<typename T> void f(T __first, T __last, const T& __val) {}
|
||||||
|
@ -6117,8 +6117,8 @@ public class AST2TemplateTests extends AST2BaseTest {
|
||||||
// }
|
// }
|
||||||
public void testFunctionSetWithNonMatchingTemplateArgs_379604() throws Exception {
|
public void testFunctionSetWithNonMatchingTemplateArgs_379604() throws Exception {
|
||||||
parseAndCheckBindings(getAboveComment(), CPP, true);
|
parseAndCheckBindings(getAboveComment(), CPP, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// template <typename T> struct C {
|
// template <typename T> struct C {
|
||||||
// typedef decltype(&T::m) dtm;
|
// typedef decltype(&T::m) dtm;
|
||||||
// };
|
// };
|
||||||
|
@ -6133,8 +6133,8 @@ public class AST2TemplateTests extends AST2BaseTest {
|
||||||
// }
|
// }
|
||||||
public void testPointerToMemberAsDependentExpression_391001() throws Exception {
|
public void testPointerToMemberAsDependentExpression_391001() throws Exception {
|
||||||
parseAndCheckBindings(getAboveComment(), CPP, true);
|
parseAndCheckBindings(getAboveComment(), CPP, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// class Memory { };
|
// class Memory { };
|
||||||
// Memory memory;
|
// Memory memory;
|
||||||
// template<Memory* m> struct Container {
|
// template<Memory* m> struct Container {
|
||||||
|
@ -6148,8 +6148,8 @@ public class AST2TemplateTests extends AST2BaseTest {
|
||||||
// }
|
// }
|
||||||
public void testAddressAsTemplateArgument_391190() throws Exception {
|
public void testAddressAsTemplateArgument_391190() throws Exception {
|
||||||
parseAndCheckBindings(getAboveComment(), CPP, true);
|
parseAndCheckBindings(getAboveComment(), CPP, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// template <typename T> struct CT {
|
// template <typename T> struct CT {
|
||||||
// const static int const_min= 1;
|
// const static int const_min= 1;
|
||||||
// };
|
// };
|
||||||
|
@ -6158,7 +6158,7 @@ public class AST2TemplateTests extends AST2BaseTest {
|
||||||
// }
|
// }
|
||||||
public void testTemplateIDAmbiguity_393959() throws Exception {
|
public void testTemplateIDAmbiguity_393959() throws Exception {
|
||||||
parseAndCheckBindings(getAboveComment(), CPP, true);
|
parseAndCheckBindings(getAboveComment(), CPP, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// template<typename T> class CT {
|
// template<typename T> class CT {
|
||||||
// void m() {
|
// void m() {
|
||||||
|
|
|
@ -658,18 +658,17 @@ public class CPPVisitor extends ASTQueries {
|
||||||
binding = new ProblemBinding(alias.getAlias(), IProblemBinding.SEMANTIC_NAME_NOT_FOUND);
|
binding = new ProblemBinding(alias.getAlias(), IProblemBinding.SEMANTIC_NAME_NOT_FOUND);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return binding;
|
return binding;
|
||||||
} else if (declaration instanceof ICPPASTAliasDeclaration) {
|
} else if (declaration instanceof ICPPASTAliasDeclaration) {
|
||||||
ICPPASTAliasDeclaration alias = (ICPPASTAliasDeclaration) declaration;
|
ICPPASTAliasDeclaration alias = (ICPPASTAliasDeclaration) declaration;
|
||||||
ICPPScope scope = (ICPPScope) getContainingScope(declaration);
|
ICPPScope scope = (ICPPScope) getContainingScope(declaration);
|
||||||
IBinding binding = scope.getBinding(alias.getAlias(), false);
|
IBinding binding = scope.getBinding(alias.getAlias(), false);
|
||||||
if (!(binding instanceof ICPPInternalBinding)) {
|
if (!(binding instanceof ICPPInternalBinding)) {
|
||||||
|
|
||||||
IType type = createType(alias.getMappingTypeId());
|
IType type = createType(alias.getMappingTypeId());
|
||||||
if (type instanceof IProblemBinding) {
|
if (type instanceof IProblemBinding) {
|
||||||
IProblemBinding problem = (IProblemBinding) type;
|
IProblemBinding problem = (IProblemBinding) type;
|
||||||
type = new CPPClassType.CPPClassTypeProblem(problem.getASTNode(), problem.getID(), alias.getMappingTypeId().getAbstractDeclarator().getName().toCharArray());
|
type = new CPPClassType.CPPClassTypeProblem(problem.getASTNode(), problem.getID(),
|
||||||
|
alias.getMappingTypeId().getAbstractDeclarator().getName().toCharArray());
|
||||||
}
|
}
|
||||||
if (type != null) {
|
if (type != null) {
|
||||||
if (alias.getParent() instanceof ICPPASTTemplateDeclaration) {
|
if (alias.getParent() instanceof ICPPASTTemplateDeclaration) {
|
||||||
|
@ -1793,7 +1792,7 @@ public class CPPVisitor extends ASTQueries {
|
||||||
if (pDtor != null) {
|
if (pDtor != null) {
|
||||||
pt = createType(pt, pDtor);
|
pt = createType(pt, pDtor);
|
||||||
}
|
}
|
||||||
pt= adjustParameterType(pt, forFuncType);
|
pt= adjustParameterType(pt, forFuncType);
|
||||||
|
|
||||||
if (pDtor != null && CPPVisitor.findInnermostDeclarator(pDtor).declaresParameterPack()) {
|
if (pDtor != null && CPPVisitor.findInnermostDeclarator(pDtor).declaresParameterPack()) {
|
||||||
pt= new CPPParameterPackType(pt);
|
pt= new CPPParameterPackType(pt);
|
||||||
|
@ -1837,13 +1836,12 @@ public class CPPVisitor extends ASTQueries {
|
||||||
return pTypes;
|
return pTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adjusts the parameter type according to 8.3.5-3:
|
* Adjusts the parameter type according to 8.3.5-3:
|
||||||
* cv-qualifiers are deleted, arrays and function types are converted to pointers.
|
* cv-qualifiers are deleted, arrays and function types are converted to pointers.
|
||||||
*/
|
*/
|
||||||
static IType adjustParameterType(final IType pt, boolean forFunctionType) {
|
static IType adjustParameterType(final IType pt, boolean forFunctionType) {
|
||||||
// bug 239975
|
// Bug 239975
|
||||||
IType t= SemanticUtil.getNestedType(pt, TDEF);
|
IType t= SemanticUtil.getNestedType(pt, TDEF);
|
||||||
if (t instanceof IArrayType) {
|
if (t instanceof IArrayType) {
|
||||||
IArrayType at = (IArrayType) t;
|
IArrayType at = (IArrayType) t;
|
||||||
|
|
Loading…
Add table
Reference in a new issue