mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-31 04:45:38 +02:00
Bug 423396 - Indexer can't evaluate operator value
Change-Id: I8edcc66e24c95d4fb0113df8a7f0c21cbf378155 Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com> Reviewed-on: https://git.eclipse.org/r/19482 Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
This commit is contained in:
parent
498762b021
commit
3c01b0d5f1
2 changed files with 26 additions and 1 deletions
|
@ -10442,4 +10442,29 @@ public class AST2CPPTests extends AST2TestBase {
|
|||
assertNotNull(bindings);
|
||||
assertEquals(1, bindings.length);
|
||||
}
|
||||
|
||||
// struct Test {
|
||||
// operator char* &();
|
||||
//
|
||||
// void test(char) {
|
||||
// Test a;
|
||||
// test(*a);
|
||||
// }
|
||||
// };
|
||||
public void testBuiltInOperator_423396() throws Exception {
|
||||
parseAndCheckBindings();
|
||||
}
|
||||
|
||||
// struct Test {
|
||||
// typedef void (*TypeFunc)(char);
|
||||
// operator TypeFunc* &();
|
||||
//
|
||||
// void test(TypeFunc) {
|
||||
// Test a;
|
||||
// test(*a);
|
||||
// }
|
||||
// };
|
||||
public void testBuiltInOperatorFunctionType_423396() throws Exception {
|
||||
parseAndCheckBindings();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -274,7 +274,7 @@ class BuiltinOperators {
|
|||
private void opDeref() {
|
||||
IType[] types= getClassConversionTypes(FIRST);
|
||||
for (IType type : types) {
|
||||
type= SemanticUtil.getNestedType(type, TDEF);
|
||||
type= SemanticUtil.getNestedType(type, TDEF|REF);
|
||||
if (isPointer(type)) {
|
||||
IType nested= SemanticUtil.getNestedType(((IPointerType) type).getType(), TDEF);
|
||||
if (nested instanceof ICPPFunctionType) {
|
||||
|
|
Loading…
Add table
Reference in a new issue