1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 18:26:01 +02:00

Bug 394151 - Regression: ClassCastException evaluating read/write flags

This commit is contained in:
Sergey Prigogin 2013-01-23 09:26:08 -08:00
parent 7a5d9818fc
commit 2820e4b9fb
2 changed files with 17 additions and 3 deletions

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2006, 2010 Wind River Systems, Inc. and others. * Copyright (c) 2006, 2013 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -8,6 +8,7 @@
* Contributors: * Contributors:
* Markus Schorn - initial API and implementation * Markus Schorn - initial API and implementation
* Andrew Ferguson (Symbian) * Andrew Ferguson (Symbian)
* Sergey Prigogin (Google)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.index.tests; package org.eclipse.cdt.internal.index.tests;
@ -475,4 +476,16 @@ public class IndexCBindingResolutionBugs extends IndexBindingResolutionTestBase
public void testDesignatedInitializer_Bug210019() throws Exception { public void testDesignatedInitializer_Bug210019() throws Exception {
IField f= getBindingFromASTName("f", 0); IField f= getBindingFromASTName("f", 0);
} }
// struct S {
// int data;
// };
// void test(void (*f)(void*)) {
// struct S *i;
// f(&i->data);
// }
public void testBug394151() throws Exception {
IParameter f= getBindingFromASTName("f(", 1);
}
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2007, 2011 Wind River Systems, Inc. and others. * Copyright (c) 2007, 2013 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -7,6 +7,7 @@
* *
* Contributors: * Contributors:
* Markus Schorn - initial API and implementation * Markus Schorn - initial API and implementation
* Sergey Prigogin (Google)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser; package org.eclipse.cdt.internal.core.dom.parser;
@ -191,7 +192,7 @@ public abstract class VariableReadWriteFlags {
final IType type= functionNameExpression.getExpressionType(); final IType type= functionNameExpression.getExpressionType();
if (type instanceof IFunctionType) { if (type instanceof IFunctionType) {
return rwArgumentForFunctionCall((IFunctionType) type, i, indirection); return rwArgumentForFunctionCall((IFunctionType) type, i, indirection);
} else { } else if (funcCall instanceof IASTImplicitNameOwner) {
IASTImplicitName[] implicitNames = ((IASTImplicitNameOwner) funcCall).getImplicitNames(); IASTImplicitName[] implicitNames = ((IASTImplicitNameOwner) funcCall).getImplicitNames();
if (implicitNames.length == 1) { if (implicitNames.length == 1) {
IASTImplicitName name = implicitNames[0]; IASTImplicitName name = implicitNames[0];