This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/35450] New: ice on valid template
- From: "mrs at apple dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Mar 2008 00:52:58 -0000
- Subject: [Bug c++/35450] New: ice on valid template
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
#include <iostream>
struct test_a{ void load(){} };
struct test_b{ };
template <template <typename> class Concept, typename Model>
struct models
{
typedef char (&yes)[2];
typedef char no;
template <template <typename> class C, typename M, typename C<M>::type
P = 0>
struct hint
{ };
template <typename M>
static yes test(M*, hint<Concept, M> * = 0);
static no test(...);
static const bool value = (sizeof(test((Model*)0))==sizeof(yes));
};
template <typename Class, typename Type>
struct member
{
typedef Type Class::* type;
};
template <typename Model>
struct loadable
{ };
int main()
{
std::cout << models<loadable, test_a>::value << std::endl;
}
# with 4.2.1:
$ g++-4.2 t.cc
t.cc: In instantiation of ?models<loadable, test_a>?:
t.cc:37: instantiated from here
t.cc:14: internal compiler error: Bus error
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
And the same with a compiler from today as well:
$ /Volumes/pool1/mrs/packages/gcc-20080308/bin/g++ t.cc
t.cc: In instantiation of ?models<loadable, test_a>?:
t.cc:37: instantiated from here
t.cc:14: internal compiler error: Bus error
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
This works on comeau.
radr://5772368
--
Summary: ice on valid template
Product: gcc
Version: 4.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mrs at apple dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35450