mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-01 14:15:23 +02:00
Bug 259648.
This commit is contained in:
parent
8e979bd30c
commit
9b6d10be72
2 changed files with 19 additions and 1 deletions
|
@ -6297,4 +6297,20 @@ public class AST2CPPTests extends AST2BaseTest {
|
|||
ba.assertNonProblem("y) {", 1, ICPPField.class);
|
||||
ba.assertProblem("y; // y is not defined", 1);
|
||||
}
|
||||
|
||||
// class A {
|
||||
// int method(int a = GREEN) {
|
||||
// return RED;
|
||||
// }
|
||||
// int x = GREEN; // GREEN is not defined
|
||||
// enum Color {
|
||||
// RED, GREEN
|
||||
// };
|
||||
// };
|
||||
public void testScopeOfClassMember_259648() throws Exception {
|
||||
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true);
|
||||
ba.assertNonProblem("GREEN)", 5, IEnumerator.class);
|
||||
ba.assertNonProblem("RED;", 3, IEnumerator.class);
|
||||
ba.assertProblem("GREEN;", 5);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1742,8 +1742,10 @@ public class CPPSemantics {
|
|||
if (temp instanceof IProblemBinding)
|
||||
continue;
|
||||
|
||||
if (!(temp instanceof ICPPMember) && !(temp instanceof IType) && !declaredBefore)
|
||||
if (!declaredBefore && !(temp instanceof ICPPMember) && !(temp instanceof IType) &&
|
||||
!(temp instanceof IEnumerator)) {
|
||||
continue;
|
||||
}
|
||||
if (temp instanceof ICPPUsingDeclaration) {
|
||||
IBinding[] bindings = ((ICPPUsingDeclaration) temp).getDelegates();
|
||||
mergeResults(data, bindings, false);
|
||||
|
|
Loading…
Add table
Reference in a new issue