From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 63070 invoked by alias); 30 Sep 2015 01:00:34 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 62964 invoked by uid 48); 30 Sep 2015 01:00:28 -0000 From: "ryan.burn at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/67774] New: [concepts] ICE when mismatching template arguments to concept Date: Wed, 30 Sep 2015 01:00:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new 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: ryan.burn at gmail dot com 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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-09/txt/msg02340.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D67774 Bug ID: 67774 Summary: [concepts] ICE when mismatching template arguments to concept Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ryan.burn at gmail dot com Target Milestone: --- Below code produces this ICE: t.cpp: In function =E2=80=98int main()=E2=80=99: t.cpp:21:16: error: wrong number of template arguments (1, should be 2) std::cout << cpt_KEvaluator << '\n'; ^ t.cpp:16:48: note: provided for =E2=80=98template constexpr const bool cpt_KEvaluator=E2=80=99 template concept bool cpt_KEvaluator =3D ^ t.cpp:21:16: internal compiler error: tree check: expected tree_vec, have error_mark in tsubst, at cp/pt.c:12570 std::cout << cpt_KEvaluator << '\n'; ^ 0xf2508c tree_check_failed(tree_node const*, char const*, int, char const*, ...) ../../gcc/gcc/tree.c:9512 0x6642bc tree_check(tree_node*, char const*, int, char const*, tree_code) ../../gcc/gcc/tree.h:2858 0x6642bc tsubst(tree_node*, tree_node*, int, tree_node*) ../../gcc/gcc/cp/pt.c:12570 0x676b70 tsubst_copy ../../gcc/gcc/cp/pt.c:13675 0x680c0a tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, boo= l, bool) ../../gcc/gcc/cp/pt.c:15474 0x66aad1 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../gcc/gcc/cp/pt.c:15044 0x66fbbc tsubst_template_arg ../../gcc/gcc/cp/pt.c:10260 0x67cd12 tsubst_template_args ../../gcc/gcc/cp/pt.c:10839 0x6621c1 tsubst(tree_node*, tree_node*, int, tree_node*) ../../gcc/gcc/cp/pt.c:12829 0x6623bf tsubst(tree_node*, tree_node*, int, tree_node*) ../../gcc/gcc/cp/pt.c:12452 0x67cd12 tsubst_template_args ../../gcc/gcc/cp/pt.c:10839 0x67fafb tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, boo= l, bool) ../../gcc/gcc/cp/pt.c:15230 0x66aad1 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../gcc/gcc/cp/pt.c:15044 0x823207 satisfy_predicate_constraint ../../gcc/gcc/cp/constraint.cc:1694 0x823207 satisfy_constraint_1 ../../gcc/gcc/cp/constraint.cc:1898 0x823f76 satisfy_constraint ../../gcc/gcc/cp/constraint.cc:1949 0x797988 finish_id_expression(tree_node*, tree_node*, tree_node*, cp_id_kin= d*, bool, bool, bool*, bool, bool, bool, bool, char const**, unsigned int) ../../gcc/gcc/cp/semantics.c:3585 0x702615 cp_parser_primary_expression ../../gcc/gcc/cp/parser.c:4817 0x70ec1b cp_parser_postfix_expression ../../gcc/gcc/cp/parser.c:6201 0x713679 cp_parser_unary_expression ../../gcc/gcc/cp/parser.c:7486 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. ////////////////////////////////////////////////////////////////// #include #include #include template concept bool cpt_RealScalar() { return std::is_floating_point::value; } namespace detail { template constexpr bool k_evaluator_impl =3D false; template constexpr bool k_evaluator_impl, E> =3D tru= e; } template concept bool cpt_KEvaluator =3D detail::k_evaluator_impl, X>; int main() { auto f =3D [](int, int, int) -> double { return 3; }; std::cout << cpt_KEvaluator << '\n'; return 0; } ////////////////////////////////////////////////////////////////// >>From gcc-bugs-return-498363-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Sep 30 01:11:17 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 85855 invoked by alias); 30 Sep 2015 01:11:16 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 85817 invoked by uid 48); 30 Sep 2015 01:11:13 -0000 From: "ryan.burn at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/67775] New: [concepts] bug when using variadic expansions in compound requirements Date: Wed, 30 Sep 2015 01:11:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new 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: ryan.burn at gmail dot com 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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-09/txt/msg02341.txt.bz2 Content-length: 2269 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67775 Bug ID: 67775 Summary: [concepts] bug when using variadic expansions in compound requirements Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ryan.burn at gmail dot com Target Milestone: --- The below code prints 0, but it should print 1. ///////////////////////////////////////////////////////////// #include #include #include template concept bool cpt_RealScalar = std::is_floating_point::value; namespace detail { template constexpr bool k_evaluator_impl = false; template requires requires(E e) { { e((Indexes, 0)...) } -> cpt_RealScalar; // requires cpt_RealScalar; // this version works } constexpr bool k_evaluator_impl, E> = true; } template concept bool cpt_KEvaluator = detail::k_evaluator_impl, X>; int main() { auto f = [](int, int, int) -> double { return 3; }; std::cout << cpt_KEvaluator << '\n'; return 0; } /////////////////////////////////////////////////////////////