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

Bug 333200: Declaration ambiguity, bit-field versus member-initializer.

This commit is contained in:
Markus Schorn 2010-12-27 15:41:25 +00:00
parent a733cd8aad
commit 11b3b8cbe7
2 changed files with 10 additions and 1 deletions

View file

@ -9317,4 +9317,13 @@ public class AST2CPPTests extends AST2BaseTest {
public void testAutoTypeInRangeBasedFor_332883() throws Exception {
parseAndCheckBindings();
}
// typedef int T;
// struct B {
// int a, b;
// B(T) : a(0), b(0) {}
// };
public void testMemberInitializer_333200() throws Exception {
parseAndCheckBindings();
}
}

View file

@ -3436,7 +3436,7 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
break loop;
case IToken.tCOLON:
if (!option.fAllowBitField)
if (!option.fAllowBitField || nestedDeclarator != null)
break loop; // no backtrack because typeid can be followed by colon
result= bitFieldDeclarator();