Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2013-01-23 17:26:08 +0000
committerSergey Prigogin2013-01-23 17:45:37 +0000
commit67b787a0ec5fa09eb3bf28709a2c63eb86f3d988 (patch)
tree33f82205019769a25065f22f8f49491b36a904e7
parent2f3ad349904be7af076505e5e28d937b6237c385 (diff)
downloadorg.eclipse.cdt-67b787a0ec5fa09eb3bf28709a2c63eb86f3d988.tar.gz
org.eclipse.cdt-67b787a0ec5fa09eb3bf28709a2c63eb86f3d988.tar.xz
org.eclipse.cdt-67b787a0ec5fa09eb3bf28709a2c63eb86f3d988.zip
Bug 394151 - Regression: ClassCastException evaluating read/write flags
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCBindingResolutionBugs.java15
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/VariableReadWriteFlags.java5
2 files changed, 17 insertions, 3 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCBindingResolutionBugs.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCBindingResolutionBugs.java
index 1f4f785bdde..ea7a3a80dd6 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCBindingResolutionBugs.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCBindingResolutionBugs.java
@@ -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
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
* Contributors:
* Markus Schorn - initial API and implementation
* Andrew Ferguson (Symbian)
+ * Sergey Prigogin (Google)
*******************************************************************************/
package org.eclipse.cdt.internal.index.tests;
@@ -475,4 +476,16 @@ public class IndexCBindingResolutionBugs extends IndexBindingResolutionTestBase
public void testDesignatedInitializer_Bug210019() throws Exception {
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);
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/VariableReadWriteFlags.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/VariableReadWriteFlags.java
index a800794bc05..b32d1f97e6a 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/VariableReadWriteFlags.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/VariableReadWriteFlags.java
@@ -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
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* Markus Schorn - initial API and implementation
+ * Sergey Prigogin (Google)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser;
@@ -191,7 +192,7 @@ public abstract class VariableReadWriteFlags {
final IType type= functionNameExpression.getExpressionType();
if (type instanceof IFunctionType) {
return rwArgumentForFunctionCall((IFunctionType) type, i, indirection);
- } else {
+ } else if (funcCall instanceof IASTImplicitNameOwner) {
IASTImplicitName[] implicitNames = ((IASTImplicitNameOwner) funcCall).getImplicitNames();
if (implicitNames.length == 1) {
IASTImplicitName name = implicitNames[0];

Back to the top