mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-30 20:35:38 +02:00
Bug 333200: Declaration ambiguity, bit-field versus member-initializer.
This commit is contained in:
parent
a733cd8aad
commit
11b3b8cbe7
2 changed files with 10 additions and 1 deletions
|
@ -9317,4 +9317,13 @@ public class AST2CPPTests extends AST2BaseTest {
|
||||||
public void testAutoTypeInRangeBasedFor_332883() throws Exception {
|
public void testAutoTypeInRangeBasedFor_332883() throws Exception {
|
||||||
parseAndCheckBindings();
|
parseAndCheckBindings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// typedef int T;
|
||||||
|
// struct B {
|
||||||
|
// int a, b;
|
||||||
|
// B(T) : a(0), b(0) {}
|
||||||
|
// };
|
||||||
|
public void testMemberInitializer_333200() throws Exception {
|
||||||
|
parseAndCheckBindings();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3436,7 +3436,7 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
||||||
break loop;
|
break loop;
|
||||||
|
|
||||||
case IToken.tCOLON:
|
case IToken.tCOLON:
|
||||||
if (!option.fAllowBitField)
|
if (!option.fAllowBitField || nestedDeclarator != null)
|
||||||
break loop; // no backtrack because typeid can be followed by colon
|
break loop; // no backtrack because typeid can be followed by colon
|
||||||
|
|
||||||
result= bitFieldDeclarator();
|
result= bitFieldDeclarator();
|
||||||
|
|
Loading…
Add table
Reference in a new issue