This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/61566] [4.9/4.10 Regression] ICE in write_unscoped_name
- From: "paolo.carlini at oracle dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 27 Jun 2014 15:25:14 +0000
- Subject: [Bug c++/61566] [4.9/4.10 Regression] ICE in write_unscoped_name
- Auto-submitted: auto-generated
- References: <bug-61566-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61566
--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Further reduced below. I think it may be just matter of loosening the
gcc_assert in write_unscoped_enum:
Index: mangle.c
===================================================================
--- mangle.c (revision 212074)
+++ mangle.c (working copy)
@@ -875,10 +875,11 @@ write_unscoped_name (const tree decl)
{
/* If not, it should be either in the global namespace, or directly
in a local function scope. A lambda can also be mangled in the
- scope of a default argument. */
+ scope of a default argument or in class scope (c++/61566). */
gcc_assert (context == global_namespace
|| TREE_CODE (context) == PARM_DECL
- || TREE_CODE (context) == FUNCTION_DECL);
+ || TREE_CODE (context) == FUNCTION_DECL
+ || TREE_CODE (context) == RECORD_TYPE);
write_unqualified_name (decl);
}
//////////////////////////
template < typename > struct function;
template < typename _Res >
struct function < _Res () >
{
template < typename _Functor>
function (_Functor);
};
struct C
{
template <typename T>
void foo (T, function < C () > = [] { });
};
void bar ()
{
C c;
c.foo (1);
}