[Bug c++/41570] [4.5 Regression] [c++0x] ICE with -g and variadic templates

2009-10-04 Thread ciaran dot mccreesh at googlemail dot com


--- Comment #1 from ciaran dot mccreesh at googlemail dot com  2009-10-04 
22:55 ---
This was introduced in svn://gcc.gnu.org/svn/gcc/tr...@152043 for bug 41266.
The DECL_NAME (parm_pack) assertion doesn't hold if the pack's empty.

This leads to a much simpler test case:

template 
struct M
{
};

struct R :
M<>
{
};


-- 

ciaran dot mccreesh at googlemail dot com changed:

   What|Removed |Added

 CC||dodji at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41570



[Bug c++/41570] New: g++ 4.5 ICE with -g and c++0x variadic templates

2009-10-04 Thread ciaran dot mccreesh at googlemail dot com
g++ (Gentoo SVN) 4.5.0-pre built 20091004 (experimental) rev. 152437

$ g++ -c -std=gnu++0x a.cc && echo ok
ok

$ g++ -c -std=gnu++0x a.cc -g && echo ok
a.cc: In instantiation of ‘M’:
a.cc:22:44:   instantiated from ‘M’
a.cc:22:44:   instantiated from ‘M’
a.cc:37:20:   instantiated from here
a.cc:21:1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugs.gentoo.org/> for instructions.

$ cat a.cc
template 
struct M;

template 
struct E
{
};

struct T
{
};

template <>
struct M<>
{
typedef T Type;
};

template 
struct M
{
typedef E::Type> Type;
};

struct A
{
};

struct R :
M::Type
{
};


-- 
   Summary: g++ 4.5 ICE with -g and c++0x variadic templates
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ciaran dot mccreesh at googlemail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41570



[Bug c++/37256] extern template / explicit instantiation broken in 4.4.0-pre

2008-08-27 Thread ciaran dot mccreesh at googlemail dot com


--- Comment #4 from ciaran dot mccreesh at googlemail dot com  2008-08-27 
17:07 ---
I don't expect it to link. I do expect it to compile. In real code I would of
course have struct B in a header and template class B; in a different
source file.

So far as I can see this is a change in behaviour in 4.4 that goes against both
the draft standard and how the GCC extension used to work, and which makes
'extern template' effectively useless.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37256



[Bug c++/37256] New: extern template / explicit instantiation broken in 4.4.0-pre

2008-08-27 Thread ciaran dot mccreesh at googlemail dot com
The following C++ code compiles (but doesn't link) with g++ 4.3.1:

template 
struct B
{
T_ f();
};

extern template class B;

void f()
{
B t;
t.f();
}

With 'gcc () 4.4.0-pre built 20080827 (Gentoo SVN ebuild) rev. 139623', the
following error occurs:

$ g++ -O1 a.cc 
a.cc: In instantiation of ‘T_ B::f() [with T_ = int]’:
a.cc:12:   instantiated from here
a.cc:12: error: explicit instantiation of ‘T_ B::f() [with T_ = int]’ but
no definition available

If no -O is specified, the error does not occur. Using -std=c++0x does not
alter the outcome.

I'm looking at n2723 14.7.2 for what the behaviour should be. My understanding
is as follows: By paragraph 7, the explicit instantiation declaration for
B is also an explicit instantiation declaration for int B::f(). Thus,
by paragraph 3, a definition of B must be available when declaring int
B::f(), which it is. But I don't see a requirement for a definition of
B::f().


-- 
   Summary: extern template / explicit instantiation broken in
4.4.0-pre
   Product: gcc
   Version: 4.4.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ciaran dot mccreesh at googlemail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37256