gcc version 3.5-tree-ssa 20040311 (merged 20040307) % cat test.c namespace Graphics { enum { kTextAlignCenter }; using Graphics::kTextAlignCenter; } % g++ -c -g test.c test.c:3: internal compiler error: in force_decl_die, at dwarf2out.c:12321 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Confirmed a regression from 3.4.0. I think this was caused by: 2004-01-27 Devang Patel <dpatel@apple.com> * Makefile.in (dwarf2out.o): Depend on input.h * dbxout.c (dbx_debug_hooks): Add new empty hook for imported_module_or_decl. (xcoff_debug_hooks): Same. * sdbout.c (sdb_debug_hooks): Same. * vmsdbgout.c (vmsdbg_debug_hooks): Same. * debug.c (do_nothing_debug_hooks): Same. (debug_nothing_tree_tree): New function. * debug.h (gcc_debug_hooks): New hook, imported_module_or_decl. * dwarf2out.c: Include input.h. (dwarf2_debug_hooks): Add new hook for imported_module_or_decl. (remove_child_TAG): New function. (dwarf_tag_name): Handle DW_TAG_imported_module. (gen_subprogram_die): Equate decl number to declaration die. Do not remove all children dies while reusing declaration die for definition. Instead, selectively remove only formal parameters. (gen_variable_die): Equate variable decl to declaration die. (gen_field_die): Equate field decl to line number. (force_namespace_die): Replace it with ... (force_decl_die): ... this. (force_type_die): New function. (setup_namespace_context): Replace use of force_namespace_die() with force_decl_die(). (gen_namespace_die): Same. (dwarf2out_imported_module_or_decl): New function.
I'll take a look.
Graham Stott posted a patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-04/msg00723.html>.
Subject: Bug 14718 CVSROOT: /cvs/gcc Module name: gcc Changes by: grahams@gcc.gnu.org 2004-05-03 13:13:16 Modified files: gcc : ChangeLog dwarf2out.c Log message: PR 14718 * dwarf2out.c (dwarf2out_imported_module_or_decl): Use force_type_die for CONST_DECL. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.3557&r2=2.3558 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/dwarf2out.c.diff?cvsroot=gcc&r1=1.515&r2=1.516
Fixed.