[Bug c++/67159] New: [c++concepts] Segfault while diagnosing constraint violation

Casey at Carter dot net gcc-bugzilla@gcc.gnu.org
Sat Aug 8 20:07:00 GMT 2015


            Bug ID: 67159
           Summary: [c++concepts] Segfault while diagnosing constraint
           Product: gcc
           Version: c++-concepts
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Casey at Carter dot net
  Target Milestone: ---

Created attachment 36149
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36149&action=edit
Preprocessed test case

r226725 crashes while diagnosing a constraint violation in this correct program
(pre-processed test case attached):

#include <stl2/detail/iterator/concepts.hpp>

template <class T>
concept bool R = requires (T& t) {
  { t.begin() } -> stl2::Iterator;
  { t.end() } -> stl2::Sentinel<decltype(t.begin())>;

struct foo {
  int* begin();
  int* end();

constexpr bool f() { return true; }


resulting in:

~/concept-gcc-r226725/bin/g++ -std=gnu++1z foo.i -c
foo.cpp:17:22: error: cannot call function ‘constexpr bool f() [with T = foo]’
foo.cpp:15:16: note:   constraints not satisfied
 constexpr bool f() { return true; }
Segmentation fault
0xc9055f crash_signal
0xf0f506 contains_struct_check(tree_node const*, tree_node_structure_enum, char
const*, int, char const*)
0xf0f506 int_cst_value(tree_node const*)
0x6d03c4 get_non_default_template_args_count
0x6da0b1 dump_template_argument_list
0x6d52bd dump_decl
0x6dae15 expr_to_string
0x6dea54 cp_printer
0x13a309a pp_format(pretty_printer*, text_info*)
0x13a0573 diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
0x13a09d1 inform(unsigned int, char const*, ...)
0x738a81 cp_build_function_call_vec(tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
0x5f1e29 build_new_function_call(tree_node*, vec<tree_node*, va_gc,
vl_embed>**, bool, int)
0x77b850 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
0x6fa019 cp_parser_postfix_expression
0x6fe92a cp_parser_unary_expression
0x6ff53f cp_parser_binary_expression
0x6ffc9f cp_parser_assignment_expression
0x700115 cp_parser_constant_expression
0x702a94 cp_parser_static_assert
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.

More information about the Gcc-bugs mailing list