1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

Bug 314113: False syntax error.

This commit is contained in:
Markus Schorn 2010-05-25 09:10:31 +00:00
parent 077a57b7a5
commit 27f89cdca5
2 changed files with 10 additions and 1 deletions

View file

@ -8554,4 +8554,12 @@ public class AST2CPPTests extends AST2BaseTest {
String code= getAboveComment();
parseAndCheckBindings(code);
}
// void test() {
// void *libHandle (0);
// }
public void testCTorInitializerForVoidPtr_314113() throws Exception {
String code= getAboveComment();
parseAndCheckBindings(code);
}
}

View file

@ -2795,7 +2795,8 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
if (CPPVisitor.doesNotSpecifyType(declspec)) {
return false;
}
if (sspec.getType() == IASTSimpleDeclSpecifier.t_void) {
if (sspec.getType() == IASTSimpleDeclSpecifier.t_void && dtor != null &&
dtor.getPointerOperators().length == 0 && dtor.getNestedDeclarator() == null) {
return false;
}
}