Bug 48935 - [C++0x] Name lookup error at enum class
Summary: [C++0x] Name lookup error at enum class
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.6.0
: P3 minor
Target Milestone: 4.6.1
Assignee: Jason Merrill
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2011-05-09 14:01 UTC by Takeshi Watanabe
Modified: 2011-05-25 15:27 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2011-05-09 14:30:51


Attachments
code (165 bytes, text/plain)
2011-05-09 14:02 UTC, Takeshi Watanabe
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Takeshi Watanabe 2011-05-09 14:01:18 UTC
I got the following error:

gcc-enum-class-test.cxx:9:7: internal compiler error: in constructor_name_p, at cp/name-lookup.c:1862
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

compiling the attached code.
I don't know much about c++0x but I think that should be an error.
Comment 1 Takeshi Watanabe 2011-05-09 14:02:33 UTC
Created attachment 24212 [details]
code
Comment 2 Jonathan Wakely 2011-05-09 14:30:51 UTC
reduced:

  enum class ENUM { a };

  ENUM::Type func() { return ENUM::a; }


possibly related to PR 43509
Comment 3 Jason Merrill 2011-05-25 14:35:20 UTC
Author: jason
Date: Wed May 25 14:35:17 2011
New Revision: 174205

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174205
Log:
	PR c++/48935
	* parser.c (cp_parser_constructor_declarator_p): Don't check
	constructor_name_p for enums.
	(cp_parser_diagnose_invalid_type_name): Correct error message.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/enum16.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/parse/error15.C
Comment 4 Jason Merrill 2011-05-25 15:26:47 UTC
Author: jason
Date: Wed May 25 15:26:42 2011
New Revision: 174210

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174210
Log:
	PR c++/48935
	* parser.c (cp_parser_constructor_declarator_p): Don't check
	constructor_name_p for enums.
	(cp_parser_diagnose_invalid_type_name): Correct error message.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/enum16.C
Modified:
    branches/gcc-4_6-branch/gcc/cp/ChangeLog
    branches/gcc-4_6-branch/gcc/cp/parser.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/parse/error15.C
Comment 5 Jason Merrill 2011-05-25 15:27:59 UTC
Fixed for 4.6.1.