asutton / gcc

Concepts rewrite for GCC
GNU General Public License v2.0
4 stars 0 forks source link

EqualityComparable(With) ICE #4

Open cjdb opened 5 years ago

cjdb commented 5 years ago

Preprocessed file

equalitycomparable.ii.txt (GitHub doesn't allow raw *.ii files, so I added .txt to trick it 😉).

Platform

Ubuntu 18.04

Linker

Gold 1.35

Flags to build GCC

See #1.

Flags to build test

See #1 (but change test from core/assignable.cpp to comparison/equalitycomparable.cpp).

Diagnostic

root@721baa14bc58:/data/build/gcc-sutton/debug# ninja concepts.comparison.equalitycomparable
[1/2] Building CXX object test/concepts/comparison/CMakeFiles/concepts.comparison.equalitycomparable.dir/equalitycomparable.cpp.o
FAILED: test/concepts/comparison/CMakeFiles/concepts.comparison.equalitycomparable.dir/equalitycomparable.cpp.o
/opt/sutton/bin/g++-sutton  -DCJDB_AUDIT_CONTRACTS -I../../../include -isystem /root/.conan/data/gsl_microsoft/20180102/bincrafters/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include -save-temps -g   -Wall -Wextra -Wno-attributes -Wsign-promo -Woverloaded-virtual -Wnon-virtual-dtor -Wodr -Werror -fdiagnostics-color=always -Wlogical-op -fstack-protector-all -std=c++2a -fsanitize=address -fsanitize=undefined -std=c++2a -MD -MT test/concepts/comparison/CMakeFiles/concepts.comparison.equalitycomparable.dir/equalitycomparable.cpp.o -MF test/concepts/comparison/CMakeFiles/concepts.comparison.equalitycomparable.dir/equalitycomparable.cpp.o.d -o test/concepts/comparison/CMakeFiles/concepts.comparison.equalitycomparable.dir/equalitycomparable.cpp.o -c ../../../test/concepts/comparison/equalitycomparable.cpp
../../../test/concepts/comparison/equalitycomparable.cpp: In function 'constexpr void check_EqualityComparable()':
../../../test/concepts/comparison/equalitycomparable.cpp:37:18: error: static assertion failed
   37 |    static_assert(not EqualityComparable<cjdb_test::not_equality_comparable3>);
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../../include/cjdb/detail/type_traits/type_traits.hpp:19,
                 from ../../../include/cjdb/detail/concepts/core/convertibleto.hpp:19,
                 from ../../../include/cjdb/detail/concepts/comparison/boolean.hpp:19,
                 from ../../../include/cjdb/detail/concepts/comparison/equalitycomparable.hpp:19,
                 from ../../../test/concepts/comparison/equalitycomparable.cpp:16:
../../../include/cjdb/detail/type_traits/expose_type.hpp: In substitution of 'template<class T>  requires requires{typename T::type;} using _t = typename T::type [with T = cjdb::common_type<const std::vector<int, std::allocator<int> >&, const int&>]':
../../../include/cjdb/detail/type_traits/common_type.hpp:56:48:   required by substitution of 'template<class ... T> using common_type_t = cjdb::_t<cjdb::common_type<T ...> > [with T = {const std::vector<int, std::allocator<int> >&, const int&}]'
../../../include/cjdb/detail/type_traits/common_reference.hpp:43:7:   required from 'struct cjdb::detail_common_reference::common_reference4<const std::vector<int>&, const int&>'
../../../include/cjdb/detail/type_traits/common_reference.hpp:62:14:   required from 'struct cjdb::detail_common_reference::common_reference3<const std::vector<int>&, const int&>'
../../../include/cjdb/detail/type_traits/common_reference.hpp:118:14:   required from 'struct cjdb::detail_common_reference::common_reference2<const std::vector<int>&, const int&>'
../../../include/cjdb/detail/type_traits/common_reference.hpp:179:11:   required from 'struct cjdb::common_reference<const std::vector<int, std::allocator<int> >&, const int&>'
../../../include/cjdb/detail/concepts/core/commonreference.hpp:43:7:   required from here
../../../include/cjdb/detail/type_traits/expose_type.hpp:22:31: internal compiler error: tree check: accessed elt 2 of tree_vec with 1 elts in map_arguments, at cp/constraint.cc:577
   22 |    using _t = typename T::type;
      |                               ^
0x202f59e tree_vec_elt_check_failed(int, int, char const*, int, char const*)
        ../../gcc/gcc/tree.c:9955
0xeda986 tree_vec_elt_check(tree_node*, int, char const*, int, char const*)
        ../../gcc/gcc/tree.h:3378
0xeda986 map_arguments
        ../../gcc/gcc/cp/constraint.cc:577
0xeda986 build_parameter_mapping
        ../../gcc/gcc/cp/constraint.cc:588
0xeda986 normalize_atom
        ../../gcc/gcc/cp/constraint.cc:608
0xeda986 normalize_expression
        ../../gcc/gcc/cp/constraint.cc:631
0xedaf3c normalize_logical_operation
        ../../gcc/gcc/cp/constraint.cc:474
0xedaabe normalize_expression
        ../../gcc/gcc/cp/constraint.cc:629
0xede266 more_constrained(tree_node*, tree_node*)
        ../../gcc/gcc/cp/constraint.cc:2143
0x1049215 more_specialized_partial_spec
        ../../gcc/gcc/cp/pt.c:23231
0x1049658 most_specialized_partial_spec
        ../../gcc/gcc/cp/pt.c:23636
0x105e564 instantiate_class_template_1
        ../../gcc/gcc/cp/pt.c:11106
0x105e564 instantiate_class_template(tree_node*)
        ../../gcc/gcc/cp/pt.c:11642
0x10e41ad complete_type(tree_node*)
        ../../gcc/gcc/cp/typeck.c:138
0x102e894 tsubst(tree_node*, tree_node*, int, tree_node*)
        ../../gcc/gcc/cp/pt.c:15117
0x103c292 tsubst_decl
        ../../gcc/gcc/cp/pt.c:13937
0x102dd77 tsubst(tree_node*, tree_node*, int, tree_node*)
        ../../gcc/gcc/cp/pt.c:14463
0x1049e82 instantiate_template_1
        ../../gcc/gcc/cp/pt.c:19842
0x1049e82 instantiate_template(tree_node*, tree_node*, int)
        ../../gcc/gcc/cp/pt.c:19898
0x102e10d instantiate_alias_template
        ../../gcc/gcc/cp/pt.c:19922
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
ninja: build stopped: subcommand failed.
cjdb commented 5 years ago

I'll leave out the StrictTotallyOrdered ICE for now: it might be a duplicate, since it's dependent on EqualityComparable.