commit 6e1aed3b584b9bf7bd3127d12516dd5ac5da7ba4
Author: Jason Merrill <jason@redhat.com>
Date: Fri May 27 12:52:37 2011 -0400
PR c++/47277
* parser.c (cp_parser_unqualified_id): Don't check
constructor_name_p for enums.
@@ -4069,7 +4069,8 @@ cp_parser_unqualified_id (cp_parser* parser,
&& (cp_lexer_peek_nth_token (parser->lexer, 2)->type
!= CPP_LESS)
&& (token->u.value == TYPE_IDENTIFIER (scope)
- || constructor_name_p (token->u.value, scope)))
+ || (CLASS_TYPE_P (scope)
+ && constructor_name_p (token->u.value, scope))))
{
cp_lexer_consume_token (parser->lexer);
return build_nt (BIT_NOT_EXPR, scope);
new file mode 100644
@@ -0,0 +1,8 @@
+// PR c++/47277
+// { dg-options -std=c++0x }
+
+int main(void) {
+ enum e {};
+ e ev;
+ ev.e::~e_u(); // { dg-error "" }
+}