This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49663] New: [4.7 Regression] [C++0x] ICE in lookup_base
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 6 Jul 2011 18:48:58 +0000
- Subject: [Bug c++/49663] New: [4.7 Regression] [C++0x] ICE in lookup_base
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49663
Summary: [4.7 Regression] [C++0x] ICE in lookup_base
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: redi@gcc.gnu.org
CC: jason@gcc.gnu.org
struct Nosm
{
int m_R;
};
namespace dx {
struct onc
{
typedef void(*Cb)();
onc(Cb cb);
};
struct grac
{
template<class Derived> static void once();
};
template<class Derived>
struct tonc : onc
{
tonc() : onc(&grac::once<Derived>) {}
static Derived& get();
};
template<class Derived> void grac::once()
{
tonc<Derived>::get().h();
}
}
namespace
{
template<typename T, int = sizeof(&T::m_R)>
struct has_R { };
template<typename T>
inline void
setR(T* m, has_R<T>* = 0)
{ }
inline void setR(...) { }
}
template<typename M>
struct Qmi
: dx::tonc<Qmi<M> >
{
void h()
{
setR(&msg);
}
M msg;
};
Qmi<Nosm> x;
ICE with -std=c++0x, none without, none with 4.6 branch
lookup_base (t=0x0, base=0x7ffff6d9e540, access=0, kind_ptr=0x0)
at /home/jwakely/src/gcc/gcc/cp/search.c:204
204 if (!TYPE_P (t))
(gdb) p t
$1 = (tree) 0x0
(gdb) bt 2
#0 lookup_base (t=0x0, base=0x7ffff6d9e540, access=0, kind_ptr=0x0)
at /home/jwakely/src/gcc/gcc/cp/search.c:204
#1 0x0000000000605fc9 in check_accessibility_of_qualified_id (
decl=0x7ffff6da41c8, object_type=0x0, nested_name_specifier=0x7ffff6d9e540)
at /home/jwakely/src/gcc/gcc/cp/semantics.c:1695
(More stack frames follow...)