def err_dup_virtual : Error<"duplicate 'virtual' in base specifier">;
// C++ operator overloading
-def err_operator_missing_type_specifier : Error<
- "missing type specifier after 'operator'">;
def err_operator_string_not_empty : Error<
"string literal after 'operator' must be '\"\"'">;
// Parse one or more of the type specifiers.
if (!ParseOptionalTypeSpecifier(DS, isInvalid, PrevSpec, DiagID,
ParsedTemplateInfo(), /*SuppressDeclarations*/true)) {
- Diag(Tok, diag::err_operator_missing_type_specifier);
+ Diag(Tok, diag::err_expected_type);
return true;
}
x.int; // expected-error{{expected unqualified-id}}
x.~int(); // expected-error{{expected a class name}}
- x.operator; // expected-error{{missing type specifier after 'operator'}}
- x.operator typedef; // expected-error{{missing type specifier after 'operator'}}
+ x.operator; // expected-error{{expected a type}}
+ x.operator typedef; // expected-error{{expected a type}}
}
void test2() {
x->int; // expected-error{{expected unqualified-id}}
x->~int(); // expected-error{{expected a class name}}
- x->operator; // expected-error{{missing type specifier after 'operator'}}
- x->operator typedef; // expected-error{{missing type specifier after 'operator'}}
+ x->operator; // expected-error{{expected a type}}
+ x->operator typedef; // expected-error{{expected a type}}
}
// PR6327
i = x.operator int();
x.operator--(); // expected-error{{no member named 'operator--'}}
x.operator float(); // expected-error{{no member named 'operator float'}}
- x.operator; // expected-error{{missing type specifier after 'operator'}}
+ x.operator; // expected-error{{expected a type}}
}
void test2() {
i = x->operator int();
x->operator--(); // expected-error{{no member named 'operator--'}}
x->operator float(); // expected-error{{no member named 'operator float'}}
- x->operator; // expected-error{{missing type specifier after 'operator'}}
+ x->operator; // expected-error{{expected a type}}
}
void bad_news(int *ip)
{
int i = 1;
- (void)new; // expected-error {{missing type specifier}}
- (void)new 4; // expected-error {{missing type specifier}}
+ (void)new; // expected-error {{expected a type}}
+ (void)new 4; // expected-error {{expected a type}}
(void)new () int; // expected-error {{expected expression}}
(void)new int[1.1]; // expected-error {{array size expression must have integral or enumerated type, not 'double'}}
(void)new int[1][i]; // expected-error {{only the first dimension}}
return new A<int>();
}
}
+
+namespace PR7702 {
+ void test1() {
+ new DoesNotExist; // expected-error {{expected a type}}
+ }
+}