diff options
author | Markus Schorn | 2012-05-07 06:10:15 +0000 |
---|---|---|
committer | Markus Schorn | 2012-05-07 06:10:15 +0000 |
commit | b1a93770192c492073589b815dcb29f907076479 (patch) | |
tree | 575dd4cf97090d260929921daf9193b68a5505b7 | |
parent | 77442617cc7d23302e446a227726b4b0e42f8e81 (diff) | |
download | org.eclipse.cdt-b1a93770192c492073589b815dcb29f907076479.tar.gz org.eclipse.cdt-b1a93770192c492073589b815dcb29f907076479.tar.xz org.eclipse.cdt-b1a93770192c492073589b815dcb29f907076479.zip |
Bug 378614: Function ptr as K&R parameter.
2 files changed, 11 insertions, 2 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2KnRTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2KnRTests.java index 452ca0e7ec2..b0717f0aa51 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2KnRTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2KnRTests.java @@ -674,4 +674,13 @@ public class AST2KnRTests extends AST2BaseTest { fail(e.getMessage()); } } + + // void push_constant (in_char, conv_base) + // char (*in_char)(void); + // int conv_base; + // {} + public void testFunctionPtrParameter_378614() throws Exception { + String code= getAboveComment(); + parseAndCheckBindings(code, ParserLanguage.C, true); + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/GNUCSourceParser.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/GNUCSourceParser.java index 9238a9a1bfd..613b0bcee29 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/GNUCSourceParser.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/GNUCSourceParser.java @@ -1620,9 +1620,9 @@ public class GNUCSourceParser extends AbstractGNUSourceCodeParser { IASTDeclarator[] decltors = declaration.getDeclarators(); for (IASTDeclarator decltor : decltors) { boolean decltorOk = false; - final char[] nchars = decltor.getName().toCharArray(); + final char[] nchars = ASTQueries.findInnermostDeclarator(decltor).getName().toCharArray(); for (IASTName parmName : parmNames) { - if (CharArrayUtils.equals(nchars, parmName.toCharArray())) { + if (CharArrayUtils.equals(nchars, parmName.toCharArray())) { decltorOk= true; break; } |