mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Comment adjustments.
This commit is contained in:
parent
fdf3bd4146
commit
6500b127d1
1 changed files with 19 additions and 20 deletions
|
@ -227,7 +227,7 @@ public class CPPSemantics {
|
||||||
|
|
||||||
private static IBinding postResolution(IBinding binding, LookupData data) {
|
private static IBinding postResolution(IBinding binding, LookupData data) {
|
||||||
if (data.checkAssociatedScopes()) {
|
if (data.checkAssociatedScopes()) {
|
||||||
//3.4.2 argument dependent name lookup, aka Koenig lookup
|
// 3.4.2 argument dependent name lookup, aka Koenig lookup
|
||||||
try {
|
try {
|
||||||
boolean doKoenig= true;
|
boolean doKoenig= true;
|
||||||
if (binding != null) {
|
if (binding != null) {
|
||||||
|
@ -249,8 +249,8 @@ public class CPPSemantics {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (binding == null && data.checkClassContainingFriend()) {
|
if (binding == null && data.checkClassContainingFriend()) {
|
||||||
//3.4.1-10 if we don't find a name used in a friend declaration in the member declaration's class
|
// 3.4.1-10 if we don't find a name used in a friend declaration in the member declaration's class
|
||||||
//we should look in the class granting friendship
|
// we should look in the class granting friendship
|
||||||
IASTNode parent = data.astName.getParent();
|
IASTNode parent = data.astName.getParent();
|
||||||
while (parent != null && !(parent instanceof ICPPASTCompositeTypeSpecifier))
|
while (parent != null && !(parent instanceof ICPPASTCompositeTypeSpecifier))
|
||||||
parent = parent.getParent();
|
parent = parent.getParent();
|
||||||
|
@ -475,7 +475,7 @@ public class CPPSemantics {
|
||||||
|
|
||||||
static private void getAssociatedScopes(IType t, ObjectSet<IScope> namespaces,
|
static private void getAssociatedScopes(IType t, ObjectSet<IScope> namespaces,
|
||||||
ObjectSet<ICPPClassType> classes, CPPASTTranslationUnit tu) throws DOMException{
|
ObjectSet<ICPPClassType> classes, CPPASTTranslationUnit tu) throws DOMException{
|
||||||
//3.4.2-2
|
// 3.4.2-2
|
||||||
if (t instanceof ICPPClassType) {
|
if (t instanceof ICPPClassType) {
|
||||||
ICPPClassType ct= (ICPPClassType) t;
|
ICPPClassType ct= (ICPPClassType) t;
|
||||||
if (!classes.containsKey(ct)) {
|
if (!classes.containsKey(ct)) {
|
||||||
|
@ -1009,8 +1009,8 @@ public class CPPSemantics {
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
boolean ok = false;
|
boolean ok = false;
|
||||||
//3.4.5-4 if the id-expression in a class member access is a qualified id... the result
|
// 3.4.5-4 if the id-expression in a class member access is a qualified id... the result
|
||||||
//is not required to be a unique base class...
|
// is not required to be a unique base class...
|
||||||
if (binding instanceof ICPPClassType) {
|
if (binding instanceof ICPPClassType) {
|
||||||
IASTNode parent = data.astName.getParent();
|
IASTNode parent = data.astName.getParent();
|
||||||
if (parent instanceof ICPPASTQualifiedName &&
|
if (parent instanceof ICPPASTQualifiedName &&
|
||||||
|
@ -1018,7 +1018,7 @@ public class CPPSemantics {
|
||||||
ok = true;
|
ok = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//it is not ambiguous if they are the same thing and it is static or an enumerator
|
// it is not ambiguous if they are the same thing and it is static or an enumerator
|
||||||
if (binding instanceof IEnumerator ||
|
if (binding instanceof IEnumerator ||
|
||||||
(binding instanceof IFunction && ASTInternal.isStatic((IFunction) binding, false)) ||
|
(binding instanceof IFunction && ASTInternal.isStatic((IFunction) binding, false)) ||
|
||||||
(binding instanceof IVariable && ((IVariable)binding).isStatic())) {
|
(binding instanceof IVariable && ((IVariable)binding).isStatic())) {
|
||||||
|
@ -1116,7 +1116,7 @@ public class CPPSemantics {
|
||||||
int namespaceIdx = -1;
|
int namespaceIdx = -1;
|
||||||
|
|
||||||
if (data.associated.containsKey(scope)) {
|
if (data.associated.containsKey(scope)) {
|
||||||
//we are looking in scope, remove it from the associated scopes list
|
// we are looking in scope, remove it from the associated scopes list
|
||||||
data.associated.remove(scope);
|
data.associated.remove(scope);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1141,7 +1141,7 @@ public class CPPSemantics {
|
||||||
ICPPASTCompositeTypeSpecifier comp = (ICPPASTCompositeTypeSpecifier) parent;
|
ICPPASTCompositeTypeSpecifier comp = (ICPPASTCompositeTypeSpecifier) parent;
|
||||||
nodes = comp.getMembers();
|
nodes = comp.getMembers();
|
||||||
|
|
||||||
//9-2 a class name is also inserted into the scope of the class itself
|
// 9-2 a class name is also inserted into the scope of the class itself
|
||||||
IASTName n = comp.getName().getLastName();
|
IASTName n = comp.getName().getLastName();
|
||||||
if (n instanceof ICPPASTTemplateId) {
|
if (n instanceof ICPPASTTemplateId) {
|
||||||
n= ((ICPPASTTemplateId) n).getTemplateName();
|
n= ((ICPPASTTemplateId) n).getTemplateName();
|
||||||
|
@ -1200,7 +1200,7 @@ public class CPPSemantics {
|
||||||
nsscope.addUsingDirective(new CPPUsingDirective(nsdef));
|
nsscope.addUsingDirective(new CPPUsingDirective(nsdef));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//possible is IASTName or IASTName[]
|
// possible is IASTName or IASTName[]
|
||||||
possible = collectResult(data, scope, item, (item == parent));
|
possible = collectResult(data, scope, item, (item == parent));
|
||||||
if (possible != null) {
|
if (possible != null) {
|
||||||
int jdx = -1;
|
int jdx = -1;
|
||||||
|
@ -1233,7 +1233,7 @@ public class CPPSemantics {
|
||||||
item = null;
|
item = null;
|
||||||
while (true) {
|
while (true) {
|
||||||
if (namespaceDefs != null) {
|
if (namespaceDefs != null) {
|
||||||
//check all definitions of this namespace
|
// check all definitions of this namespace
|
||||||
while (++namespaceIdx < namespaceDefs.length) {
|
while (++namespaceIdx < namespaceDefs.length) {
|
||||||
nodes = ((ICPPASTNamespaceDefinition)namespaceDefs[namespaceIdx].getParent()).getDeclarations();
|
nodes = ((ICPPASTNamespaceDefinition)namespaceDefs[namespaceIdx].getParent()).getDeclarations();
|
||||||
if (nodes.length > 0) {
|
if (nodes.length > 0) {
|
||||||
|
@ -1243,7 +1243,7 @@ public class CPPSemantics {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (parent instanceof IASTCompoundStatement && nodes instanceof IASTParameterDeclaration[]) {
|
} else if (parent instanceof IASTCompoundStatement && nodes instanceof IASTParameterDeclaration[]) {
|
||||||
//function body, we were looking at parameters, now check the body itself
|
// function body, we were looking at parameters, now check the body itself
|
||||||
IASTCompoundStatement compound = (IASTCompoundStatement) parent;
|
IASTCompoundStatement compound = (IASTCompoundStatement) parent;
|
||||||
nodes = compound.getStatements();
|
nodes = compound.getStatements();
|
||||||
if (nodes.length > 0) {
|
if (nodes.length > 0) {
|
||||||
|
@ -1416,7 +1416,7 @@ public class CPPSemantics {
|
||||||
ICPPASTCompositeTypeSpecifier compSpec = (ICPPASTCompositeTypeSpecifier) declSpec;
|
ICPPASTCompositeTypeSpecifier compSpec = (ICPPASTCompositeTypeSpecifier) declSpec;
|
||||||
specName = compSpec.getName();
|
specName = compSpec.getName();
|
||||||
|
|
||||||
//anonymous union? //GCC supports anonymous structs too
|
// anonymous union? //GCC supports anonymous structs too
|
||||||
if (declarators.length == 0 && /*compSpec.getKey() == IASTCompositeTypeSpecifier.k_union &&*/
|
if (declarators.length == 0 && /*compSpec.getKey() == IASTCompositeTypeSpecifier.k_union &&*/
|
||||||
specName.getSimpleID().length == 0)
|
specName.getSimpleID().length == 0)
|
||||||
{
|
{
|
||||||
|
@ -1450,7 +1450,7 @@ public class CPPSemantics {
|
||||||
IASTEnumerationSpecifier enumeration = (IASTEnumerationSpecifier) declSpec;
|
IASTEnumerationSpecifier enumeration = (IASTEnumerationSpecifier) declSpec;
|
||||||
specName = enumeration.getName();
|
specName = enumeration.getName();
|
||||||
|
|
||||||
//check enumerators too
|
// check enumerators too
|
||||||
IASTEnumerator[] list = enumeration.getEnumerators();
|
IASTEnumerator[] list = enumeration.getEnumerators();
|
||||||
IASTName tempName;
|
IASTName tempName;
|
||||||
for (IASTEnumerator enumerator : list) {
|
for (IASTEnumerator enumerator : list) {
|
||||||
|
@ -1506,7 +1506,7 @@ public class CPPSemantics {
|
||||||
if (!((ICPPASTDeclSpecifier) functionDef.getDeclSpecifier()).isFriend()) {
|
if (!((ICPPASTDeclSpecifier) functionDef.getDeclSpecifier()).isFriend()) {
|
||||||
IASTFunctionDeclarator declarator = functionDef.getDeclarator();
|
IASTFunctionDeclarator declarator = functionDef.getDeclarator();
|
||||||
|
|
||||||
//check the function itself
|
// check the function itself
|
||||||
IASTName declName = CPPVisitor.findInnermostDeclarator(declarator).getName();
|
IASTName declName = CPPVisitor.findInnermostDeclarator(declarator).getName();
|
||||||
ASTInternal.addName(scope, declName);
|
ASTInternal.addName(scope, declName);
|
||||||
|
|
||||||
|
@ -1527,8 +1527,8 @@ public class CPPSemantics {
|
||||||
if (phn instanceof ICPPASTCompositeTypeSpecifier == false && phn instanceof ICPPASTNamespaceDefinition == false)
|
if (phn instanceof ICPPASTCompositeTypeSpecifier == false && phn instanceof ICPPASTNamespaceDefinition == false)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
//A qualified name implies the name actually belongs to a different scope, and should
|
// A qualified name implies the name actually belongs to a different scope, and should
|
||||||
//not be considered here, except the qualifier names the scope itself
|
// not be considered here, except the qualifier names the scope itself
|
||||||
final ICPPASTQualifiedName qname = (ICPPASTQualifiedName) potential;
|
final ICPPASTQualifiedName qname = (ICPPASTQualifiedName) potential;
|
||||||
if (scope instanceof CPPScope == false || ((CPPScope) scope).canDenoteScopeMember(qname))
|
if (scope instanceof CPPScope == false || ((CPPScope) scope).canDenoteScopeMember(qname))
|
||||||
return false;
|
return false;
|
||||||
|
@ -2031,7 +2031,6 @@ public class CPPSemantics {
|
||||||
if (data.forFunctionDeclaration())
|
if (data.forFunctionDeclaration())
|
||||||
return firstViable;
|
return firstViable;
|
||||||
|
|
||||||
|
|
||||||
final IType[] sourceParameters = getSourceParameterTypes(data.functionParameters); // the parameters the function is being called with
|
final IType[] sourceParameters = getSourceParameterTypes(data.functionParameters); // the parameters the function is being called with
|
||||||
if (CPPTemplates.containsDependentType(sourceParameters)) {
|
if (CPPTemplates.containsDependentType(sourceParameters)) {
|
||||||
if (viableCount == 1)
|
if (viableCount == 1)
|
||||||
|
@ -2149,7 +2148,7 @@ public class CPPSemantics {
|
||||||
// then this is an ambiguity (unless we find something better than both later).
|
// then this is an ambiguity (unless we find something better than both later).
|
||||||
ambiguous |= (hasWorse && hasBetter) || (!hasWorse && !hasBetter);
|
ambiguous |= (hasWorse && hasBetter) || (!hasWorse && !hasBetter);
|
||||||
|
|
||||||
// mstodo if ambigous ??
|
// mstodo if ambiguous ??
|
||||||
if (!hasWorse) {
|
if (!hasWorse) {
|
||||||
// If they are both template functions, we can order them that way
|
// If they are both template functions, we can order them that way
|
||||||
ICPPFunctionTemplate bestAsTemplate= asTemplate(bestFn);
|
ICPPFunctionTemplate bestAsTemplate= asTemplate(bestFn);
|
||||||
|
@ -2296,7 +2295,7 @@ public class CPPSemantics {
|
||||||
(prop == IASTExpressionList.NESTED_EXPRESSION &&
|
(prop == IASTExpressionList.NESTED_EXPRESSION &&
|
||||||
node.getParent().getPropertyInParent() == IASTFunctionCallExpression.PARAMETERS)) {
|
node.getParent().getPropertyInParent() == IASTFunctionCallExpression.PARAMETERS)) {
|
||||||
// target is a parameter of a function
|
// target is a parameter of a function
|
||||||
// if this function call refers to an overloaded function, there is more than one possiblity
|
// if this function call refers to an overloaded function, there is more than one possibility
|
||||||
// for the target type
|
// for the target type
|
||||||
IASTFunctionCallExpression fnCall = null;
|
IASTFunctionCallExpression fnCall = null;
|
||||||
int idx = -1;
|
int idx = -1;
|
||||||
|
|
Loading…
Add table
Reference in a new issue