type_t const *const type = skip_typeref(entity->typedefe.type);
if (!is_type_void(type))
return true;
- if (type->base.qualifiers != TYPE_QUALIFIER_NONE) {
+ if (c_mode & _CXX) {
+ /* ISO/IEC 14882:1998(E) §8.3.5:2 It must be literally (void). A typedef
+ * is not allowed. */
+ errorf(HERE, "empty parameter list defined with a typedef of 'void' not allowed in C++");
+ } else if (type->base.qualifiers != TYPE_QUALIFIER_NONE) {
/* §6.7.5.3:10 Qualification is not allowed here. */
errorf(HERE, "'void' as parameter must not have type qualifiers");
}
statement_t *statement = NULL;
/* declaration or statement */
- add_anchor_token(';');
switch (token.kind) {
case T_IDENTIFIER: {
token_kind_t la1_type = (token_kind_t)look_ahead(1)->kind;
default:
errorf(HERE, "unexpected token %K while parsing statement", &token);
statement = create_error_statement();
- if (!at_anchor())
- next_token();
+ eat_until_anchor();
break;
}
- rem_anchor_token(';');
assert(statement != NULL
&& statement->base.source_position.input_name != NULL);
add_anchor_token('*');
add_anchor_token('+');
add_anchor_token('-');
+ add_anchor_token(';');
add_anchor_token('{');
add_anchor_token('~');
add_anchor_token(T_CHARACTER_CONSTANT);
rem_anchor_token(T_CHARACTER_CONSTANT);
rem_anchor_token('~');
rem_anchor_token('{');
+ rem_anchor_token(';');
rem_anchor_token('-');
rem_anchor_token('+');
rem_anchor_token('*');