public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/67164] New: [6 Regression] ICE: tree check: expected class ‘expression’, have ‘exceptional’ (argument_pack_select) in tree_operand_check, at tree.h:3356
@ 2015-08-09  9:08 trippels at gcc dot gnu.org
  2015-08-23 10:09 ` [Bug c++/67164] " trippels at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: trippels at gcc dot gnu.org @ 2015-08-09  9:08 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 67164
           Summary: [6 Regression] ICE: tree check: expected class
                    ‘expression’, have ‘exceptional’
                    (argument_pack_select) in tree_operand_check, at
                    tree.h:3356
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: trippels at gcc dot gnu.org
  Target Milestone: ---

% cat github_113.ii
namespace std {
template <typename _Tp> struct integral_constant {
  static constexpr _Tp value = 0;
};
template <bool, typename, typename> struct conditional;
template <typename...> struct __or_;
template <typename _B1, typename _B2>
struct __or_<_B1, _B2> : conditional<1, _B1, _B2> {};
template <typename...> struct __and_;
template <typename _B1, typename _B2>
struct __and_<_B1, _B2> : conditional<1, _B2, _B1> {};
template <typename> struct is_rvalue_reference;
template <typename _Tp>
struct is_reference
    : __or_<integral_constant<bool>, is_rvalue_reference<_Tp>>::type {};
template <typename _Tp> _Tp declval();
struct __do_is_direct_constructible_impl {
  template <typename _Tp, typename _Arg,
            typename = decltype(_Tp(declval<_Arg>()))>
  static integral_constant<bool> __test(int);
};
template <typename _Tp, typename _Arg>
struct __is_direct_constructible_impl : __do_is_direct_constructible_impl {
  decltype(__test<_Tp, _Arg>(0)) type;
};
template <typename _Tp, typename _Arg>
struct __is_direct_constructible_new_safe
    : __and_<int, __is_direct_constructible_impl<_Tp, _Arg>> {};
template <typename _Tp, typename _Arg>
struct __is_direct_constructible_new
    : conditional<is_reference<_Tp>::value, int,
                  __is_direct_constructible_new_safe<_Tp, _Arg>> {};
template <typename _Tp, typename _Arg>
struct __is_direct_constructible
    : __is_direct_constructible_new<_Tp, _Arg>::type {};
template <typename...> struct __is_nary_constructible;
template <typename _Tp, typename _Arg>
struct __is_nary_constructible<_Tp, _Arg>
    : __is_direct_constructible<_Tp, _Arg> {};
template <typename _Tp, typename... _Args>
struct is_constructible : __is_nary_constructible<_Tp, _Args...>::type {};
template <bool> struct enable_if;
template <bool, typename _Iftrue, typename> struct conditional {
  typedef _Iftrue type;
};
template <typename _Iftrue, typename _Iffalse>
struct conditional<false, _Iftrue, _Iffalse> {
  typedef _Iffalse type;
};
}
namespace boost {
namespace hana {
template <bool> struct fast_and;
template <typename... Xn> struct closure {
  template <typename... Yn,
            typename = std::enable_if<
                fast_and<std::is_constructible<Xn, Yn &&>::value...>::value>>
  closure(Yn...);
  template <typename... Yn,
            typename std::enable_if<
                fast_and<std::is_constructible<Yn>::value...>::value>::type>
  closure(closure<Yn...>);
};
template <typename> struct make_impl;
template <typename Datatype> struct make_t {
  template <typename... X> decltype(auto) operator()(X... x) {
    return make_impl<Datatype>::apply(x...);
  }
};
template <typename Datatype> make_t<Datatype> make;
struct Pair;
auto make_pair = make<Pair>;
struct Tuple;
auto make_tuple = make<Tuple>;
template <> struct make_impl<Tuple> {
  template <typename... Xs> static closure<Xs...> apply(Xs &&...);
};
struct pair : closure<> {
  using closure::closure;
};
template <> struct make_impl<Pair> {
  template <typename F, typename S> static pair apply(F, S);
};
namespace struct_detail {
template <typename Memptr, Memptr> struct member_ptr {};
template <int, typename> auto prepare_member_name_impl() {}
template <int n, typename> auto prepare_member_name() {
  return prepare_member_name_impl<n, int>;
}
}
}
}
struct Person {
  int Person;
  auto apply() {
    struct member_names;
    boost::hana::make_tuple(boost::hana::make_pair(
        boost::hana::struct_detail::prepare_member_name<0, member_names>(),
        boost::hana::struct_detail::member_ptr<decltype(&Person::Person),
                                               &Person::Person>{}));
  }
};

 % clang++ -std=c++14 -c github_113.ii
 %

(gcc-5 rejects the testcase)
 % g++ -std=c++14 -c github_113.ii
github_113.ii: In instantiation of ‘struct
std::__is_direct_constructible_impl<boost::hana::pair&,
boost::hana::closure<boost::hana::pair&>&&>’:
github_113.ii:41:8:   required from ‘struct
std::is_constructible<boost::hana::pair&,
boost::hana::closure<boost::hana::pair&>&&>’
github_113.ii:56:13:   required by substitution of ‘template<class ... Yn,
class> boost::hana::closure<Xn>::closure(Yn ...) [with Yn =
boost::hana::closure<boost::hana::pair&
>; <template-parameter-1-2> = <missing>]’
github_113.ii:67:43:   required from ‘decltype(auto)
boost::hana::make_t<Datatype>::operator()(X ...) [with X = {boost::hana::pair};
Datatype = boost::hana::Tuple]’
github_113.ii:100:67:   required from here
github_113.ii:24:29: error: no matching function for call to
‘std::__is_direct_constructible_impl<boost::hana::pair&,
boost::hana::closure<boost::hana::pair&>&&>::__test(int)
’
   decltype(__test<_Tp, _Arg>(0)) type;
                             ^
github_113.ii:20:34: note: candidate: template<class _Tp, class _Arg, class>
static std::integral_constant<bool>
std::__do_is_direct_constructible_impl::__test(int)
   static integral_constant<bool> __test(int);
                                  ^
github_113.ii:20:34: note:   template argument deduction/substitution failed:
github_113.ii:19:13: error: invalid cast of an rvalue expression of type
‘boost::hana::closure<boost::hana::pair&>’ to type ‘boost::hana::pair&’
             typename = decltype(_Tp(declval<_Arg>()))>
             ^

(trunk ICEs since r214396)
 % g++ -c github_113.ii
github_113.ii: In substitution of ‘template<class ... Yn, typename
std::enable_if<boost::hana::fast_and<std::is_constructible<Yn>::value
...>::value>::type <anonymous> >
boost::hana::pair::pair(boost::hana::closure<Xs ...>) [with Yn = <missing>;
typename std::enable_if<boost::hana::fast_and<std::is_constructible<Yn>::value
...>::value>::type <anonymous> = <missing>]’:
github_113.ii:19:13:   required by substitution of ‘template<class _Tp, class
_Arg, class> static std::integral_constant<bool>
std::__do_is_direct_constructible_impl::__test(int) [with _Tp =
boost::hana::pair&; _Arg = boost::hana::closure<boost::hana::pair&>&&;
<template-parameter-1-3> = <missing>]’
github_113.ii:24:29:   required from ‘struct
std::__is_direct_constructible_impl<boost::hana::pair&,
boost::hana::closure<boost::hana::pair&>&&>’
github_113.ii:41:8:   required from ‘struct
std::is_constructible<boost::hana::pair&,
boost::hana::closure<boost::hana::pair&>&&>’
github_113.ii:56:13:   required by substitution of ‘template<class ... Yn,
class> boost::hana::closure<Xn>::closure(Yn ...) [with Yn =
boost::hana::closure<boost::hana::pair&>; <template-parameter-1-2> =
<missing>]’
github_113.ii:67:43:   required from ‘decltype(auto)
boost::hana::make_t<Datatype>::operator()(X ...) [with X = {boost::hana::pair};
Datatype = boost::hana::Tuple]’
github_113.ii:100:67:   required from here
github_113.ii:19:13: internal compiler error: tree check: expected class
‘expression’, have ‘exceptional’ (argument_pack_select) in tree_operand_check,
at tree.h:3356
             typename = decltype(_Tp(declval<_Arg>()))>
             ^
0x10d3fcb7 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        ../../gcc/gcc/tree.c:9550
0x101160e3 expr_check
        ../../gcc/gcc/tree.h:3027
0x101160e3 tree_operand_check
        ../../gcc/gcc/tree.h:3356
0x102387cb tree_operand_check
        ../../gcc/gcc/tree.h:2972
0x102387cb unify
        ../../gcc/gcc/cp/pt.c:19046
0x102360ab unify
        ../../gcc/gcc/cp/pt.c:19096
0x101167b3 try_class_unification
        ../../gcc/gcc/cp/pt.c:18100
0x102356db unify
        ../../gcc/gcc/cp/pt.c:19134
0x1023a96f unify_one_argument
        ../../gcc/gcc/cp/pt.c:17450
0x10230277 type_unification_real
        ../../gcc/gcc/cp/pt.c:17522
0x10241453 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:16969
0x1018b31b add_template_candidate_real
        ../../gcc/gcc/cp/call.c:3054
0x1018bf4f add_template_candidate
        ../../gcc/gcc/cp/call.c:3151
0x1018bf4f add_candidates
        ../../gcc/gcc/cp/call.c:5307
0x101875d3 build_user_type_conversion_1
        ../../gcc/gcc/cp/call.c:3662
0x10187ffb implicit_conversion
        ../../gcc/gcc/cp/call.c:1853
0x1018981b reference_binding
        ../../gcc/gcc/cp/call.c:1701
0x10187e27 implicit_conversion
        ../../gcc/gcc/cp/call.c:1792
0x10191aef perform_direct_initialization_if_possible(tree_node*, tree_node*,
bool, int)
        ../../gcc/gcc/cp/call.c:9570
0x10342c73 build_static_cast_1
        ../../gcc/gcc/cp/typeck.c:6631
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
>From gcc-bugs-return-494466-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Aug 09 09:45:02 2015
Return-Path: <gcc-bugs-return-494466-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 26001 invoked by alias); 9 Aug 2015 09:45:02 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 25963 invoked by uid 48); 9 Aug 2015 09:44:57 -0000
From: "trippels at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/67164] ICE: tree check:=?UTF-8?Q? expected class ‘expression’?=,=?UTF-8?Q? have ‘exceptional’ ?=(argument_pack_select) in tree_operand_check, at tree.h:3356
Date: Sun, 09 Aug 2015 09:45:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: trippels at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: short_desc cf_known_to_fail
Message-ID: <bug-67164-4-hetVfLzPs8@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67164-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67164-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-08/txt/msg00608.txt.bz2
Content-length: 2106

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[6 Regression] ICE: tree    |ICE: tree check: expected
                   |check: expected class       |class ‘expression’, have
                   |‘expression’, have          |‘exceptional’
                   |‘exceptional’               |(argument_pack_select) in
                   |(argument_pack_select) in   |tree_operand_check, at
                   |tree_operand_check, at      |tree.h:3356
                   |tree.h:3356                 |
      Known to fail|                            |5.1.0, 6.0

--- Comment #1 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
With --enable-checking gcc-5 also ICEs.

gcc-4.9 rejects the testcase:

github_113.ii:70:47: error: template declaration of
‘boost::hana::make_t<Datatype> boost::hana::make’
 template <typename Datatype> make_t<Datatype> make;
                                               ^
github_113.ii:72:18: error: ‘make’ was not declared in this scope
 auto make_pair = make<Pair>;
                  ^
github_113.ii:72:27: error: expected primary-expression before ‘>’ token
 auto make_pair = make<Pair>;
                           ^
github_113.ii:72:28: error: expected primary-expression before ‘;’ token
 auto make_pair = make<Pair>;
                            ^
github_113.ii:74:19: error: ‘make’ was not declared in this scope
 auto make_tuple = make<Tuple>;
                   ^
github_113.ii:74:29: error: expected primary-expression before ‘>’ token
 auto make_tuple = make<Tuple>;
                             ^
github_113.ii:74:30: error: expected primary-expression before ‘;’ token
 auto make_tuple = make<Tuple>;
                              ^
>From gcc-bugs-return-494467-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Aug 09 10:33:07 2015
Return-Path: <gcc-bugs-return-494467-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 73269 invoked by alias); 9 Aug 2015 10:33:07 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 73207 invoked by uid 48); 9 Aug 2015 10:33:02 -0000
From: "trippels at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/67164] ICE: tree check:=?UTF-8?Q? expected class ‘expression’?=,=?UTF-8?Q? have ‘exceptional’ ?=(argument_pack_select) in tree_operand_check, at tree.h:3356
Date: Sun, 09 Aug 2015 10:33:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: trippels at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-67164-4-kT1dwZPJ0m@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67164-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67164-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-08/txt/msg00609.txt.bz2
Content-length: 490

https://gcc.gnu.org/bugzilla/show_bug.cgi?idg164

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ldionne.2 at gmail dot com

--- Comment #2 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
(Louis, this ICE was introduced by commit 8a0ddb0fa7b6f7a of
https://github.com/ldionne/hana)


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-10-01  9:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-09  9:08 [Bug c++/67164] New: [6 Regression] ICE: tree check: expected class ‘expression’, have ‘exceptional’ (argument_pack_select) in tree_operand_check, at tree.h:3356 trippels at gcc dot gnu.org
2015-08-23 10:09 ` [Bug c++/67164] " trippels at gcc dot gnu.org
2015-08-27 19:53 ` ldionne.2 at gmail dot com
2015-08-28  4:33 ` trippels at gcc dot gnu.org
2021-10-01  9:48 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).