https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61539

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-06-17
                 CC|                            |trippels at gcc dot gnu.org
   Target Milestone|---                         |4.8.5
            Summary|ICE: in unify_one_argument, |[4.8/4.9/4.10 Regression]
                   |at cp/pt.c:15465            |ICE: in unify_one_argument,
                   |validate(value_store,       |at cp/pt.c:15465
                   |new_tokens, (T*)0, 0);      |
     Ever confirmed|0                           |1
      Known to fail|                            |4.10.0, 4.8.3, 4.9.0

--- Comment #1 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Confirmed.

markus@x4 tmp % cat test.ii
template <typename _CharT> class A;
template <typename> class B;
template <class charT> class C;
template <> class C<char>
{
  virtual void xparse (int &, const B<A<char> > &) const;
};
template <class T, class charT = char> class G : C<charT>
{
public:
  G (void *) {}
  void default_value (const T &);
  void xparse (int &, const B<A<charT> > &) const;
};
template <class T, class charT>
void validate (int &, const B<A<charT> > &, T *, int);
template <class T, class charT>
void G<T, charT>::xparse (int &p1, const B<A<charT> > &p2) const
{
  validate (p1, p2, (T *)0, 0);
}
template <class T> G<T> *value (T *) { G<T> *r = new G<T>(0); }
namespace Eigen
{
template <typename T> struct D;
template <typename, int, int, int = 0 ?: 0, int = 0, int = 0 > class F;
template <typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows,
          int _MaxCols>
struct D<F<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
{
  typedef _Scalar Scalar;
};
template <typename, int, int, int, int, int _MaxCols> class F
{
public:
  typedef typename Eigen::D<F>::Scalar Scalar;
  F (const Scalar &, const Scalar &, const Scalar &);
};
template <class... T>
void validate (int &, const B<A<char> > &, Eigen::F<T...> *);
}
int main (int, char *[])
{
  Eigen::F<double, 3, 1> a (0, 0, 0);
  value (&a)->default_value (Eigen::F<double, 3, 1>(0, 0, 0));
}

markus@x4 tmp % clang++ -w -c -std=c++11 test.ii
markus@x4 tmp % g++ -c -std=c++11 test.ii
test.ii: In substitution of ‘template<class ... T> void Eigen::validate(int&,
const B<A<char> >&, Eigen::F<T ...>*) [with T = <missing>]’:
test.ii:20:30:   required from ‘void G<T, charT>::xparse(int&, const B<A<charT>
>&) const [with T = Eigen::F<double, 3, 1>; charT = char]’
test.ii:46:1:   required from here
test.ii:20:30: internal compiler error: in unify_one_argument, at cp/pt.c:16504
   validate (p1, p2, (T *)0, 0);
                              ^
0x5e66fc unify_one_argument
        ../../gcc/gcc/cp/pt.c:16503
0x5e7562 unify_pack_expansion
        ../../gcc/gcc/cp/pt.c:17322
0x5e5b6b unify
        ../../gcc/gcc/cp/pt.c:18077
0x4fccc7 try_class_unification
        ../../gcc/gcc/cp/pt.c:17084
0x5e2bff unify
        ../../gcc/gcc/cp/pt.c:18105
0x5e2dec unify
        ../../gcc/gcc/cp/pt.c:17973
0x5e64f7 unify_one_argument
        ../../gcc/gcc/cp/pt.c:16509
0x5e894c type_unification_real
        ../../gcc/gcc/cp/pt.c:16581
0x5f2973 fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node*
const*, unsigned int, tree_node*, unification_kind_t, int, bool, bool)
        ../../gcc/gcc/cp/pt.c:16019
0x55e9d1 add_template_candidate_real
        ../../gcc/gcc/cp/call.c:3008
0x55f4ac add_template_candidate
        ../../gcc/gcc/cp/call.c:3105
0x55f4ac add_candidates
        ../../gcc/gcc/cp/call.c:5233
0x561cf9 perform_overload_resolution
        ../../gcc/gcc/cp/call.c:3953
0x56430a build_new_function_call(tree_node*, vec<tree_node*, va_gc,
vl_embed>**, bool, int)
        ../../gcc/gcc/cp/call.c:4030
0x6e1d74 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
        ../../gcc/gcc/cp/semantics.c:2365
0x5b7446 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/gcc/cp/pt.c:14958
0x5c7a4e tsubst_expr
        ../../gcc/gcc/cp/pt.c:14137
0x5c8455 tsubst_expr
        ../../gcc/gcc/cp/pt.c:13563
0x5c8a37 tsubst_expr
        ../../gcc/gcc/cp/pt.c:13735
0x5c55ae instantiate_decl(tree_node*, int, bool)
        ../../gcc/gcc/cp/pt.c:20047
Please submit a full bug report,

Reply via email to