mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 09:46:02 +02:00
Bug 326778: Bogus ambiguity due to different using declarations for the same variable.
This commit is contained in:
parent
3178c362a2
commit
d212cbc763
2 changed files with 23 additions and 2 deletions
|
@ -1279,7 +1279,6 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
// char32_t c32;
|
// char32_t c32;
|
||||||
// f(c16); f(c32);
|
// f(c16); f(c32);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
public void testChar16_Bug319186() throws Exception {
|
public void testChar16_Bug319186() throws Exception {
|
||||||
IFunction f= getBindingFromASTName("f(c16)", 1);
|
IFunction f= getBindingFromASTName("f(c16)", 1);
|
||||||
assertEquals("char16_t", ASTTypeUtil.getType(f.getType().getParameterTypes()[0]));
|
assertEquals("char16_t", ASTTypeUtil.getType(f.getType().getParameterTypes()[0]));
|
||||||
|
@ -1287,4 +1286,26 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
f= getBindingFromASTName("f(c32)", 1);
|
f= getBindingFromASTName("f(c32)", 1);
|
||||||
assertEquals("char32_t", ASTTypeUtil.getType(f.getType().getParameterTypes()[0]));
|
assertEquals("char32_t", ASTTypeUtil.getType(f.getType().getParameterTypes()[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// namespace ns {
|
||||||
|
// extern int* var;
|
||||||
|
// void fun();
|
||||||
|
// typedef int Type;
|
||||||
|
// }
|
||||||
|
// using ns::var;
|
||||||
|
// using ns::fun;
|
||||||
|
// using ns::Type;
|
||||||
|
|
||||||
|
// #include "header.h"
|
||||||
|
// using namespace ::ns;
|
||||||
|
// void sabel() {
|
||||||
|
// var = 0;
|
||||||
|
// fun();
|
||||||
|
// Type x;
|
||||||
|
// }
|
||||||
|
public void test_Bug326778() throws Exception {
|
||||||
|
IVariable v= getBindingFromASTName("var", 0);
|
||||||
|
IFunction f= getBindingFromASTName("fun", 0);
|
||||||
|
ITypedef t= getBindingFromASTName("Type", 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1926,7 +1926,7 @@ public class CPPSemantics {
|
||||||
} else {
|
} else {
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
obj = temp;
|
obj = temp;
|
||||||
} else if (obj == temp) {
|
} else if (obj.equals(temp)) {
|
||||||
// Ok, delegates are synonyms.
|
// Ok, delegates are synonyms.
|
||||||
} else {
|
} else {
|
||||||
int c = compareByRelevance(data.tu, obj, temp);
|
int c = compareByRelevance(data.tu, obj, temp);
|
||||||
|
|
Loading…
Add table
Reference in a new issue