[Bug c++/80562] [7/8 Regression] ICE using if constexpr with nonconstant expression in function template

2017-06-20 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80562

Volker Reichelt  changed:

   What|Removed |Added

 CC||reichelt at gcc dot gnu.org

--- Comment #5 from Volker Reichelt  ---
*** Bug 80971 has been marked as a duplicate of this bug. ***

[Bug c++/80971] [7/8 Regression] ICE with 'if constexpr' in template function

2017-06-20 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80971

Volker Reichelt  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #2 from Volker Reichelt  ---
Fixed with Jason's patch for PR80562, so marking as duplicate.

*** This bug has been marked as a duplicate of bug 80562 ***

[Bug c++/79650] [5/6/7/8 Regression] ICE on invalid c++ code with label arithmetic in convert_nontype_argument (pt.c:6515)

2017-06-11 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79650

Volker Reichelt  changed:

   What|Removed |Added

   Keywords|error-recovery  |
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-06-11
 CC||reichelt at gcc dot gnu.org
Summary|ICE on invalid c++ code |[5/6/7/8 Regression] ICE on
   |with -std=c++1z in  |invalid c++ code with label
   |convert_nontype_argument|arithmetic in
   |(pt.c:6515) |convert_nontype_argument
   ||(pt.c:6515)
 Ever confirmed|0   |1

--- Comment #2 from Volker Reichelt  ---
Here's a reduced testcase. It ICEs with -std++0x since GCC 4.7.0:


template struct A {};

void foo()
{
L:
M:
  A<(__INTPTR_TYPE__)&&M - (__INTPTR_TYPE__)&&L> a;
};


PR79650.cc: In function 'void foo()':
PR79650.cc:11:48: internal compiler error: in convert_nontype_argument, at
cp/pt.c:6598
   A<(__INTPTR_TYPE__)&&M - (__INTPTR_TYPE__)&&L> a;
^
0x62ba48 convert_nontype_argument
../../gcc/gcc/cp/pt.c:6598
0x62ba48 convert_template_argument
../../gcc/gcc/cp/pt.c:7753
0x960573 coerce_template_parms
../../gcc/gcc/cp/pt.c:8211
0x96453a lookup_template_class_1
../../gcc/gcc/cp/pt.c:8747
0x96453a lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
../../gcc/gcc/cp/pt.c:9092
0x99035d finish_template_type(tree_node*, tree_node*, int)
../../gcc/gcc/cp/semantics.c:3185
0x904664 cp_parser_template_id
../../gcc/gcc/cp/parser.c:15522
0x9047ff cp_parser_class_name
../../gcc/gcc/cp/parser.c:21970
0x9166d2 cp_parser_qualifying_entity
../../gcc/gcc/cp/parser.c:6289
0x9166d2 cp_parser_nested_name_specifier_opt
../../gcc/gcc/cp/parser.c:5975
0x91984f cp_parser_simple_type_specifier
../../gcc/gcc/cp/parser.c:16856
0x90c60d cp_parser_type_specifier
../../gcc/gcc/cp/parser.c:16529
0x91e5d4 cp_parser_decl_specifier_seq
../../gcc/gcc/cp/parser.c:13357
0x9255b1 cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:12682
0x926425 cp_parser_block_declaration
../../gcc/gcc/cp/parser.c:12629
0x926e09 cp_parser_declaration_statement
../../gcc/gcc/cp/parser.c:12239
0x8ff110 cp_parser_statement
../../gcc/gcc/cp/parser.c:10726
0x90004d cp_parser_statement_seq_opt
../../gcc/gcc/cp/parser.c:11058
0x90011f cp_parser_compound_statement
../../gcc/gcc/cp/parser.c:11012
0x919103 cp_parser_function_body
../../gcc/gcc/cp/parser.c:21449
Please submit a full bug report, [etc.]

[Bug c++/81061] New: [7/8 Regression] ICE modifying read-only variable

2017-06-11 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81061

Bug ID: 81061
   Summary: [7/8 Regression] ICE modifying read-only variable
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: error-recovery, ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following invalid testcase triggers an ICE since GCC 7.1.0:

===
const int i = 0;

void foo()
{
  (0, i) = 1;
}
===

bug.cc: In function 'void foo()':
bug.cc:5:12: error: assignment of read-only location '((void)0, i)'
   (0, i) = 1;
^
gimplification failed:
0  constant
0>
bug.cc:5:5: internal compiler error: gimplification failed
   (0, i) = 1;
   ~~^~~~
0xc34e38 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:12261
0xc42ac5 gimplify_modify_expr
../../gcc/gcc/gimplify.c:5504
0xc33a52 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:11297
0xc36e18 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:6521
0xc3497a gimplify_cleanup_point_expr
../../gcc/gcc/gimplify.c:6265
0xc3497a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:11673
0xc36e18 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:6521
0xc38711 gimplify_body(tree_node*, bool)
../../gcc/gcc/gimplify.c:12494
0xc38bdc gimplify_function_tree(tree_node*)
../../gcc/gcc/gimplify.c:12652
0xaceddf cgraph_node::analyze()
../../gcc/gcc/cgraphunit.c:665
0xad1763 analyze_functions
../../gcc/gcc/cgraphunit.c:1126
0xad2652 symbol_table::finalize_compilation_unit()
../../gcc/gcc/cgraphunit.c:2611
Please submit a full bug report, [etc.]

[Bug c++/81060] New: [8 Regression] ICE with un-expanded parameter pack

2017-06-11 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81060

Bug ID: 81060
   Summary: [8 Regression] ICE with un-expanded parameter pack
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: error-recovery, ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following invalid testcase triggers an ICE on trunk:


template struct A
{
  static const int i;
};

template const int A::i = []{ return 0; }();


bug.cc:6:41: error: template definition of non-template 'const int A::i'
 template const int A::i = []{ return 0; }();
 ^
bug.cc:6:46: error: parameter packs not expanded with '...':
 template const int A::i = []{ return 0; }();
  ^
bug.cc:6:46: note: 'T'
bug.cc:6:46: error: parameter packs not expanded with '...':
bug.cc:6:46: note: 'T'


Internal compiler error: Error reporting routines re-entered.
0x767408 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
../../gcc/gcc/tree.c:9909
0x5f69d1 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
../../gcc/gcc/tree.h:3206
0x5f69d1 dump_lambda_function
../../gcc/gcc/cp/error.c:1551
0x5f69d1 dump_function_decl
../../gcc/gcc/cp/error.c:1605
0x8aab6c decl_as_string_translate(tree_node*, int)
../../gcc/gcc/cp/error.c:2983
0x9a8b80 cxx_printable_name_internal
../../gcc/gcc/cp/tree.c:2546
0x8a8a62 cp_print_error_function
../../gcc/gcc/cp/error.c:3317
0x8a8a62 cp_diagnostic_starter
../../gcc/gcc/cp/error.c:3271
0x165f93b diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
../../gcc/gcc/diagnostic.c:975
0x165fc7e diagnostic_impl
../../gcc/gcc/diagnostic.c:1099
0x16608a4 internal_error(char const*, ...)
../../gcc/gcc/diagnostic.c:1410
0x767408 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
../../gcc/gcc/tree.c:9909
0x5f69d1 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
../../gcc/gcc/tree.h:3206
0x5f69d1 dump_lambda_function
../../gcc/gcc/cp/error.c:1551
0x5f69d1 dump_function_decl
../../gcc/gcc/cp/error.c:1605
0x8aab6c decl_as_string_translate(tree_node*, int)
../../gcc/gcc/cp/error.c:2983
0x9a8b80 cxx_printable_name_internal
../../gcc/gcc/cp/tree.c:2546
0x8a8a62 cp_print_error_function
../../gcc/gcc/cp/error.c:3317
0x8a8a62 cp_diagnostic_starter
../../gcc/gcc/cp/error.c:3271
0x165f93b diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
../../gcc/gcc/diagnostic.c:975
Please submit a full bug report, [etc.]

The regression appeared between 2017-05-09 and 2017-05-12.

[Bug c++/81057] New: [5/6/7/8 Regression] ICE with broken default template parameter

2017-06-11 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81057

Bug ID: 81057
   Summary: [5/6/7/8 Regression] ICE with broken default template
parameter
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following invalid code snippet (compiled with -std=c++11) triggers
an ICE since GCC 5.1.0:

==
struct A
{
  constexpr operator bool() const { return true; }
};

template struct B {};

template> void foo() {}
==

bug.cc:8:25: error: 'x' was not declared in this scope
 template> void foo() {}
 ^
bug.cc:8:26: internal compiler error: in build_address, at cp/typeck.c:5619
 template> void foo() {}
  ^
0x83ef77 build_address(tree_node*)
../../gcc/gcc/cp/typeck.c:5619
0x60b787 add_function_candidate
../../gcc/gcc/cp/call.c:2164
0x60d1f7 add_candidates
../../gcc/gcc/cp/call.c:5480
0x6082ab add_candidates
../../gcc/gcc/cp/call.c:3844
0x6082ab build_user_type_conversion_1
../../gcc/gcc/cp/call.c:3845
0x609c98 implicit_conversion
../../gcc/gcc/cp/call.c:1898
0x60f702 build_integral_nontype_arg_conv(tree_node*, tree_node*, int)
../../gcc/gcc/cp/call.c:4029
0x7c536c convert_nontype_argument
../../gcc/gcc/cp/pt.c:6579
0x7c536c convert_template_argument
../../gcc/gcc/cp/pt.c:7740
0x7c6433 coerce_template_parms
../../gcc/gcc/cp/pt.c:8198
0x7cbb6a lookup_template_class_1
../../gcc/gcc/cp/pt.c:8734
0x7cbb6a lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
../../gcc/gcc/cp/pt.c:9079
0x80126d finish_template_type(tree_node*, tree_node*, int)
../../gcc/gcc/cp/semantics.c:3185
0x74cf14 cp_parser_template_id
../../gcc/gcc/cp/parser.c:15518
0x74d12f cp_parser_class_name
../../gcc/gcc/cp/parser.c:21966
0x760432 cp_parser_qualifying_entity
../../gcc/gcc/cp/parser.c:6289
0x760432 cp_parser_nested_name_specifier_opt
../../gcc/gcc/cp/parser.c:5975
0x76391a cp_parser_simple_type_specifier
../../gcc/gcc/cp/parser.c:16852
0x755bed cp_parser_type_specifier
../../gcc/gcc/cp/parser.c:16525
0x756b32 cp_parser_type_specifier_seq
../../gcc/gcc/cp/parser.c:20794
Please submit a full bug report, [etc.]

[Bug c++/81055] New: [5/6/7/8 Regression] ICE with invalid initializer for array new

2017-06-11 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81055

Bug ID: 81055
   Summary: [5/6/7/8 Regression] ICE with invalid initializer for
array new
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: error-recovery, ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following invalid code snippet (compiled with -std=c++0x) triggers
an ICE since GCC 4.7.0:

==
int** p = new int*[1]{q};
==

bug.cc:1:23: error: 'q' was not declared in this scope
 int** p = new int*[1]{q};
   ^
bug.cc: In function 'void __static_initialization_and_destruction_0(int, int)':
bug.cc:1:24: internal compiler error: tree check: expected class 'type', have
'exceptional' (error_mark) in useless_type_conversion_p, at gimple-expr.c:84
 int** p = new int*[1]{q};
^
0x5d3be5 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
../../gcc/gcc/tree.c:9909
0xacd134 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
../../gcc/gcc/tree.h:3206
0xacd134 useless_type_conversion_p(tree_node*, tree_node*)
../../gcc/gcc/gimple-expr.c:84
0xb0c901 gimplify_modify_expr
../../gcc/gcc/gimplify.c:5443
0xafaee2 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:11297
0xafdc08 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:6521
0xafa6ca gimplify_cleanup_point_expr
../../gcc/gcc/gimplify.c:6265
0xafa6ca gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:11673
0xafdc08 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:6521
0xaf944b gimplify_statement_list
../../gcc/gcc/gimplify.c:1721
0xaf944b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:11725
0xafdc08 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:6521
0xaf977c gimplify_and_add(tree_node*, gimple**)
../../gcc/gcc/gimplify.c:438
0xaf977c gimplify_loop_expr
../../gcc/gcc/gimplify.c:1695
0xaf977c gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:11501
0xafdc08 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:6521
0xaf944b gimplify_statement_list
../../gcc/gcc/gimplify.c:1721
0xaf944b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:11725
0xafdc08 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:6521
0xaf944b gimplify_statement_list
../../gcc/gcc/gimplify.c:1721
Please submit a full bug report, [etc.]

[Bug c++/81054] New: [7/8 Regression] ICE with volatile variable in constexpr function

2017-06-11 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81054

Bug ID: 81054
   Summary: [7/8 Regression] ICE with volatile variable in
constexpr function
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: error-recovery, ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following invalid code snippet (compiled with -std=c++1z) triggers
an ICE since GCC 7.1.0:

==
struct A
{
  volatile int i;
  constexpr A() : i() {}
};

struct B
{
  static constexpr A a {};
};
==

bug.cc:9:25: error: the type 'const A' of constexpr variable 'B::a' is not
literal
   static constexpr A a {};
 ^
bug.cc:1:8: note: 'A' is not literal because:
 struct A
^
bug.cc:3:16: note:   non-static data member 'A::i' has volatile type
   volatile int i;
^
bug.cc:9:22: error: in-class initialization of static data member 'const A
B::a' of non-literal type
   static constexpr A a {};
  ^
bug.cc:9:25: internal compiler error: in make_rtl_for_nonlocal_decl, at
cp/decl.c:6427
   static constexpr A a {};
 ^
0x684049 make_rtl_for_nonlocal_decl
../../gcc/gcc/cp/decl.c:6425
0x6abdda cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
../../gcc/gcc/cp/decl.c:7092
0x6ca9ee grokfield(cp_declarator const*, cp_decl_specifier_seq*, tree_node*,
bool, tree_node*, tree_node*)
../../gcc/gcc/cp/decl2.c:956
0x752dbd cp_parser_member_declaration
../../gcc/gcc/cp/parser.c:23421
0x753a3a cp_parser_member_specification_opt
../../gcc/gcc/cp/parser.c:22958
0x753a3a cp_parser_class_specifier_1
../../gcc/gcc/cp/parser.c:22111
0x755f31 cp_parser_class_specifier
../../gcc/gcc/cp/parser.c:22363
0x755f31 cp_parser_type_specifier
../../gcc/gcc/cp/parser.c:16449
0x768e21 cp_parser_decl_specifier_seq
../../gcc/gcc/cp/parser.c:13353
0x770e01 cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:12678
0x771cf5 cp_parser_block_declaration
../../gcc/gcc/cp/parser.c:12625
0x744584 cp_parser_declaration
../../gcc/gcc/cp/parser.c:12523
0x779b2b cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:12399
0x779e0a cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4364
0x779e0a c_parse_file()
../../gcc/gcc/cp/parser.c:38475
0x8ba5b6 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.c:1104
Please submit a full bug report, [etc.]

[Bug c++/81032] New: [5/6/7/8 Regression] ICE with lambda and broken constexpr

2017-06-08 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81032

Bug ID: 81032
   Summary: [5/6/7/8 Regression] ICE with lambda and broken
constexpr
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Keywords: error-recovery, ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following invalid code snippet triggers an ICE since GCC 5.2.0
(when compiled with -std=c++1y):


template constexpr void foo(T t)
{
  constexpr int i = t;
  [=](auto){ return i; }(0);
}

void bar()
{
  foo(0);
}


bug.cc: In instantiation of 'constexpr void foo(T) [with T = int]':
bug.cc:9:8:   required from here
bug.cc:3:17: error: 't' is not a constant expression
   constexpr int i = t;
 ^
bug.cc: In instantiation of 'foo(T):: [with auto:1 = int; T =
int]':
bug.cc:4:25:   required from 'constexpr void foo(T) [with T = int]'
bug.cc:9:8:   required from here
bug.cc:4:24: internal compiler error: in finish_member_declaration, at
cp/semantics.c:3003
   [=](auto){ return i; }(0);
^
0x63fa91 finish_member_declaration(tree_node*)
../../gcc/gcc/cp/semantics.c:3000
0x8b99bf add_capture(tree_node*, tree_node*, tree_node*, bool, bool)
../../gcc/gcc/cp/lambda.c:591
0x8b9f6e add_default_capture(tree_node*, tree_node*, tree_node*)
../../gcc/gcc/cp/lambda.c:653
0x95bd2b tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
../../gcc/gcc/cp/pt.c:17821
0x944bf4 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/gcc/cp/pt.c:16521
0x943a23 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/gcc/cp/pt.c:15781
0x9447d6 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/gcc/cp/pt.c:15998
0x9447d6 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/gcc/cp/pt.c:15998
0x971e2b instantiate_decl(tree_node*, bool, bool)
../../gcc/gcc/cp/pt.c:22963
0x89414e maybe_instantiate_decl
../../gcc/gcc/cp/decl2.c:4994
0x896248 mark_used(tree_node*, int)
../../gcc/gcc/cp/decl2.c:5094
0x7f6bcc build_over_call
../../gcc/gcc/cp/call.c:8102
0x804a03 build_op_call_1
../../gcc/gcc/cp/call.c:4509
0x804a03 build_op_call(tree_node*, vec**, int)
../../gcc/gcc/cp/call.c:4535
0x98d17d finish_call_expr(tree_node*, vec**, bool,
bool, int)
../../gcc/gcc/cp/semantics.c:2496
0x95bae3 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
../../gcc/gcc/cp/pt.c:17414
0x944bf4 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/gcc/cp/pt.c:16521
0x943100 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/gcc/cp/pt.c:15785
0x94315f tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/gcc/cp/pt.c:15771
0x9447d6 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/gcc/cp/pt.c:15998
Please submit a full bug report, [etc.]

[Bug c++/81013] New: [7/8 Regression] ICE with invalid union in class hierarchy

2017-06-07 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81013

Bug ID: 81013
   Summary: [7/8 Regression] ICE with invalid union in class
hierarchy
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Keywords: error-recovery, ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following invalid code snippet triggers an ICE since GCC 7.1.0:

=
struct A
{
  virtual void foo() const;
};

union B : A
{
  void foo() const;
};

void bar(const B& b)
{
  b.foo();
}
=

bug.cc:6:11: error: derived union 'B' invalid
 union B : A
   ^
during GIMPLE pass: *build_cgraph_edges
bug.cc: In function 'void bar(const B&)':
bug.cc:11:6: internal compiler error: in create_indirect_edge, at cgraph.c:962
 void bar(const B& b)
  ^~~
0x96667b cgraph_node::create_indirect_edge(gcall*, int, profile_count, int,
bool)
../../gcc/gcc/cgraph.c:962
0x96bd2c execute
../../gcc/gcc/cgraphbuild.c:341
Please submit a full bug report, [etc.]

[Bug c++/81011] New: [6/7/8 Regression] ICE with #pragma omp task and inaccessible copy-constructor

2017-06-07 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81011

Bug ID: 81011
   Summary: [6/7/8 Regression] ICE with #pragma omp task and
inaccessible copy-constructor
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Keywords: error-recovery, ice-on-invalid-code, openmp
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following invalid code snippet triggers an ICE since GCC 6.1.0
(when compiled with -fopenmp):

==
class A
{
  A(const A&);
};

void foo(const A&);

void bar(const A& a)
{
#pragma omp task
  foo(a);
}
==

bug.cc: In function 'void bar(const A&)':
bug.cc:10:9: error: 'A::A(const A&)' is private within this context
 #pragma omp task
 ^~~
bug.cc:3:3: note: declared private here
   A(const A&);
   ^
during GIMPLE pass: omplower
bug.cc:10:9: internal compiler error: Segmentation fault
 #pragma omp task
 ^~~
0xd7564f crash_signal
../../gcc/gcc/toplev.c:338
0xc624f1 scan_sharing_clauses
../../gcc/gcc/omp-low.c:1405
0xc65f58 scan_omp_task
../../gcc/gcc/omp-low.c:1881
0xc65f58 scan_omp_1_stmt
../../gcc/gcc/omp-low.c:3170
0xae9376 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
../../gcc/gcc/gimple-walk.c:568
0xae9570 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
../../gcc/gcc/gimple-walk.c:51
0xae9441 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
../../gcc/gcc/gimple-walk.c:595
0xae9570 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
../../gcc/gcc/gimple-walk.c:51
0xc59b3d scan_omp
../../gcc/gcc/omp-low.c:3246
0xc6f35a execute_lower_omp
../../gcc/gcc/omp-low.c:8981
0xc6f35a execute
../../gcc/gcc/omp-low.c:9028
Please submit a full bug report, [etc.]

[Bug c++/70621] [6/7/8 Regression] ICE on invalid code at -O1 and above on x86_64-linux-gnu in record_reference, at cgraphbuild.c:64

2017-06-07 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70621

Volker Reichelt  changed:

   What|Removed |Added

   Last reconfirmed|2016-04-11 00:00:00 |2017-06-07
 CC||reichelt at gcc dot gnu.org

--- Comment #10 from Volker Reichelt  ---
Here's an even simpler example that ICEs since GCC 4.9.0:

=
float foo();

struct A
{
  static float x;
};

double A::x = foo();

void bar()
{
  A::x = 0;
}
=

bug.cc:8:11: error: conflicting declaration 'double A::x'
 double A::x = foo();
   ^
bug.cc:5:16: note: previous declaration as 'float A::x'
   static float x;
^
bug.cc:8:11: error: declaration of 'float A::x' outside of class is not
definition [-fpermissive]
 double A::x = foo();
   ^
cc1plus: internal compiler error: in record_reference, at cgraphbuild.c:64
0x96b754 record_reference
../../gcc/gcc/cgraphbuild.c:64
0x1048663 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*, tree_node*
(*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*,
hash_set >*))
../../gcc/gcc/tree.c:11838
0x1048ef2 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*, tree_node*
(*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*,
hash_set >*))
../../gcc/gcc/tree.c:12155
0x96c952 record_references_in_initializer(tree_node*, bool)
../../gcc/gcc/cgraphbuild.c:401
0x1088e07 varpool_node::analyze()
../../gcc/gcc/varpool.c:532
0x972916 analyze_functions
../../gcc/gcc/cgraphunit.c:1180
0x973cc2 symbol_table::finalize_compilation_unit()
../../gcc/gcc/cgraphunit.c:2611
Please submit a full bug report, [etc.]

[Bug c++/81007] New: [7/8 Regression] ICE with virtual function in broken class

2017-06-07 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81007

Bug ID: 81007
   Summary: [7/8 Regression] ICE with virtual function in broken
class
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: error-recovery, ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following invalid testcase triggers an ICE since GCC 7.1.0
(when compiled with -O2):

===
struct A
{
  A p;
  virtual void foo();
};

struct B : A {};

void bar(B& b)
{
  b.foo();
}
===

bug.cc:3:5: error: field 'p' has incomplete type 'A'
   A p;
 ^
bug.cc:1:8: note: definition of 'struct A' is not complete until the closing
brace
 struct A
^
bug.cc: In function 'void bar(B&)':
bug.cc:11:8: internal compiler error: Segmentation fault
   b.foo();
   ~^~
0xd7564f crash_signal
../../gcc/gcc/toplev.c:338
0xb878af contains_struct_check(tree_node const*, tree_node_structure_enum, char
const*, int, char const*)
../../gcc/gcc/tree.h:3452
0xb878af wi::extended_tree<128>::extended_tree(tree_node const*)
../../gcc/gcc/tree.h:5307
0xb878af generic_wide_int >::generic_wide_int(tree_node const* const&)
../../gcc/gcc/wide-int.h:745
0xb878af wi::to_offset(tree_node const*)
../../gcc/gcc/tree.h:5290
0xb878af int_bit_position(tree_node const*)
../../gcc/gcc/tree.h:5453
0xb878af ipa_polymorphic_call_context::restrict_to_inner_class(tree_node*,
bool, bool)
../../gcc/gcc/ipa-polymorphic-call.c:273
0xb886d2 contains_type_p
../../gcc/gcc/ipa-polymorphic-call.c:478
0xb86f89 ipa_polymorphic_call_context::speculation_consistent_p(tree_node*,
long, bool, tree_node*) const
../../gcc/gcc/ipa-polymorphic-call.c:1824
0xb88be5 ipa_polymorphic_call_context::combine_speculation_with(tree_node*,
long, bool, tree_node*)
../../gcc/gcc/ipa-polymorphic-call.c:1857
0xb8acc2 ipa_polymorphic_call_context::ipa_polymorphic_call_context(tree_node*,
tree_node*, gimple*, tree_node**)
../../gcc/gcc/ipa-polymorphic-call.c:909
0xae23ba possible_polymorphic_call_targets(tree_node*, gimple*, bool*, void**)
../../gcc/gcc/ipa-utils.h:126
0xadea93 gimple_fold_call
../../gcc/gcc/gimple-fold.c:3705
0xadf622 fold_stmt_1
../../gcc/gcc/gimple-fold.c:4456
0xb0fd43 gimplify_call_expr
../../gcc/gcc/gimplify.c:3364
0xb05515 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:11269
0xb08938 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:6521
0xb0545a gimplify_cleanup_point_expr
../../gcc/gcc/gimplify.c:6265
0xb0545a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:11673
0xb08938 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:6521
Please submit a full bug report, [etc.]

[Bug c/81006] New: ICE with zero-size array and #pragma omp task depend

2017-06-07 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81006

Bug ID: 81006
   Summary: ICE with zero-size array and #pragma omp task depend
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code, openmp
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following (valid?) testcase triggers an ICE since GCC 4.9.0
(when compiled with -fopenmp):

===
int a[] = {};

void foo()
{
  #pragma omp task depend(out: a[:])
{}
}
===

bug.c: In function 'foo':
bug.c:5:11: internal compiler error: in size_binop_loc, at fold-const.c:1770
   #pragma omp task depend(out: a[:])
   ^~~
0x885b57 size_binop_loc(unsigned int, tree_code, tree_node*, tree_node*)
../../gcc/gcc/fold-const.c:1769
0x6237da handle_omp_array_sections_1
../../gcc/gcc/c/c-typeck.c:12365
0x62431d handle_omp_array_sections
../../gcc/gcc/c/c-typeck.c:12508
0x6287a8 c_finish_omp_clauses(tree_node*, c_omp_region_type)
../../gcc/gcc/c/c-typeck.c:13334
0x63684e c_parser_omp_task
../../gcc/gcc/c/c-parser.c:15713
0x63684e c_parser_omp_construct
../../gcc/gcc/c/c-parser.c:17405
0x63789e c_parser_pragma
../../gcc/gcc/c/c-parser.c:10393
0x655f5d c_parser_compound_statement_nostart
../../gcc/gcc/c/c-parser.c:4892
0x65653e c_parser_compound_statement
../../gcc/gcc/c/c-parser.c:4757
0x6527e7 c_parser_declaration_or_fndef
../../gcc/gcc/c/c-parser.c:2125
0x65a223 c_parser_external_declaration
../../gcc/gcc/c/c-parser.c:1468
0x65ac89 c_parser_translation_unit
../../gcc/gcc/c/c-parser.c:1349
0x65ac89 c_parse_file()
../../gcc/gcc/c/c-parser.c:18131
0x6b8566 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.c:1104
Please submit a full bug report, [etc.]

[Bug c++/80991] New: ICE with __is_trivially_constructible in template

2017-06-06 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80991

Bug ID: 80991
   Summary: ICE with __is_trivially_constructible in template
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following valid code snippet triggers an ICE since GCC 5.1.0:


template void foo()
{
  static_assert(__is_trivially_constructible(int, int), "");
}

void bar()
{
  foo();
}


bug.cc: In function 'void foo()':
bug.cc:3:60: internal compiler error: tree check: expected class 'type', have
'exceptional' (tree_list) in dependent_type_p, at cp/pt.c:23555
   static_assert(__is_trivially_constructible(int, int), "");
^
0x1029257 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
../../gcc/gcc/tree.c:9909
0x78cebf tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
../../gcc/gcc/tree.h:3206
0x78cebf dependent_type_p(tree_node*)
../../gcc/gcc/cp/pt.c:23555
0x805787 finish_static_assert(tree_node*, tree_node*, unsigned int, bool)
../../gcc/gcc/cp/semantics.c:8823
0x7577d0 cp_parser_static_assert
../../gcc/gcc/cp/parser.c:13651
0x76f9b6 cp_parser_block_declaration
../../gcc/gcc/cp/parser.c:12622
0x770199 cp_parser_declaration_statement
../../gcc/gcc/cp/parser.c:12235
0x744ef3 cp_parser_statement
../../gcc/gcc/cp/parser.c:10722
0x745fbd cp_parser_statement_seq_opt
../../gcc/gcc/cp/parser.c:11054
0x74608f cp_parser_compound_statement
../../gcc/gcc/cp/parser.c:11008
0x760853 cp_parser_function_body
../../gcc/gcc/cp/parser.c:21445
0x760853 cp_parser_ctor_initializer_opt_and_function_body
../../gcc/gcc/cp/parser.c:21483
0x765e61 cp_parser_function_definition_after_declarator
../../gcc/gcc/cp/parser.c:26290
0x74f8bd cp_parser_function_definition_from_specifiers_and_declarator
../../gcc/gcc/cp/parser.c:26202
0x74f8bd cp_parser_init_declarator
../../gcc/gcc/cp/parser.c:19168
0x74fe3a cp_parser_single_declaration
../../gcc/gcc/cp/parser.c:26748
0x76910c cp_parser_template_declaration_after_parameters
../../gcc/gcc/cp/parser.c:26352
0x768d94 cp_parser_explicit_template_declaration
../../gcc/gcc/cp/parser.c:26587
0x768d94 cp_parser_template_declaration_after_export
../../gcc/gcc/cp/parser.c:26606
0x741c79 cp_parser_declaration
../../gcc/gcc/cp/parser.c:12472
Please submit a full bug report, [etc.]

[Bug c++/80984] New: [5/6/7/8 Regression] ICE with label/variable ambiguity

2017-06-05 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80984

Bug ID: 80984
   Summary: [5/6/7/8 Regression] ICE with label/variable ambiguity
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following valid code snippet triggers an ICE since GCC 5.1.0:

===
struct A
{
  ~A();
};

A foo()
{
  A a;
  a:
  return a;
}
===

bug.cc: In function 'A foo()':
bug.cc:11:1: internal compiler error: tree check: expected var_decl or
parm_decl or result_decl, have label_decl in cp_genericize, at
cp/cp-gimplify.c:1594
 }
 ^
0x1028c1c tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc/gcc/tree.c:9859
0x66927a tree_check3(tree_node*, char const*, int, char const*, tree_code,
tree_code, tree_code)
../../gcc/gcc/tree.h:3123
0x66927a cp_genericize(tree_node*)
../../gcc/gcc/cp/cp-gimplify.c:1594
0x6a6c52 finish_function(int)
../../gcc/gcc/cp/decl.c:15708
0x765e7e cp_parser_function_definition_after_declarator
../../gcc/gcc/cp/parser.c:26296
0x74f8bd cp_parser_function_definition_from_specifiers_and_declarator
../../gcc/gcc/cp/parser.c:26202
0x74f8bd cp_parser_init_declarator
../../gcc/gcc/cp/parser.c:19168
0x76e92c cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:12800
0x76f6c5 cp_parser_block_declaration
../../gcc/gcc/cp/parser.c:12625
0x741b74 cp_parser_declaration
../../gcc/gcc/cp/parser.c:12523
0x77753b cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:12399
0x77781a cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4364
0x77781a c_parse_file()
../../gcc/gcc/cp/parser.c:38475
0x8b9066 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.c:1104
Please submit a full bug report, [etc.]

[Bug c++/79056] [7/8 Regression] [C++17] ICE with broken deduction guide / broken template parameter

2017-06-05 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79056

Volker Reichelt  changed:

   What|Removed |Added

   Keywords||error-recovery
   Last reconfirmed|2017-01-30 00:00:00 |2017-06-05
Summary|[C++17] ICE with broken |[7/8 Regression] [C++17]
   |deduction guide |ICE with broken deduction
   ||guide / broken template
   ||parameter

--- Comment #3 from Volker Reichelt  ---
While Martin's example doesn't ICE for me, the following code snippet
crashes with a very similar stack trace (when using -std=c++1z).
Btw, it only takes a single space to make it valid:

===
template struct A {};

template void foo(A=A()) {}

void bar()
{
  foo(A());
}
===

PR79056.cc:3:41: error: template argument 1 is invalid
 template void foo(A=A()) {}
 ^
PR79056.cc:3:41: error: template argument 1 is invalid
PR79056.cc:3:41: error: template argument 1 is invalid
PR79056.cc:3:41: error: template argument 1 is invalid
PR79056.cc:3:31: internal compiler error: Segmentation fault
 template void foo(A=A()) {}
   ^
0xd724ef crash_signal
../../gcc/gcc/toplev.c:337
0x736779 cp_parser_check_for_invalid_template_id
../../gcc/gcc/cp/parser.c:2986
0x7390b5 cp_parser_check_for_invalid_template_id
../../gcc/gcc/cp/parser.c:2984
0x7390b5 cp_parser_simple_type_specifier
../../gcc/gcc/cp/parser.c:16945
0x726c8d cp_parser_type_specifier
../../gcc/gcc/cp/parser.c:16499
0x727eda cp_parser_decl_specifier_seq
../../gcc/gcc/cp/parser.c:13330
0x742d25 cp_parser_parameter_declaration
../../gcc/gcc/cp/parser.c:21183
0x7435ec cp_parser_parameter_declaration_list
../../gcc/gcc/cp/parser.c:20999
0x743a5c cp_parser_parameter_declaration_clause
../../gcc/gcc/cp/parser.c:20922
0x72a471 cp_parser_direct_declarator
../../gcc/gcc/cp/parser.c:19645
0x72a471 cp_parser_declarator
../../gcc/gcc/cp/parser.c:19521
0x72278c cp_parser_init_declarator
../../gcc/gcc/cp/parser.c:19046
0x72381a cp_parser_single_declaration
../../gcc/gcc/cp/parser.c:26719
0x7456dc cp_parser_template_declaration_after_parameters
../../gcc/gcc/cp/parser.c:26323
0x745364 cp_parser_explicit_template_declaration
../../gcc/gcc/cp/parser.c:26558
0x745364 cp_parser_template_declaration_after_export
../../gcc/gcc/cp/parser.c:26577
0x74d589 cp_parser_declaration
../../gcc/gcc/cp/parser.c:12449
0x74f0ab cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:12376
0x74f38a cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4366
0x74f38a c_parse_file()
../../gcc/gcc/cp/parser.c:38431
Please submit a full bug report, [etc.]

This makes it a regression for GCC 7.

[Bug c++/62207] [5/6/7/8 Regression] ICE: tree check: expected tree that contains 'decl minimal' structure, have 'overload' in tsubst_copy, at cp/pt.c

2017-06-05 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62207

Volker Reichelt  changed:

   What|Removed |Added

   Keywords||ice-checking
   Last reconfirmed|2014-12-14 00:00:00 |2017-06-05
 CC||reichelt at gcc dot gnu.org
Summary|ICE: tree check: expected   |[5/6/7/8 Regression] ICE:
   |tree that contains 'decl|tree check: expected tree
   |minimal' structure, have|that contains 'decl
   |'overload' in tsubst_copy,  |minimal' structure, have
   |at cp/pt.c  |'overload' in tsubst_copy,
   ||at cp/pt.c

--- Comment #5 from Volker Reichelt  ---
Marc's code snippet can be reduced to the following invalid code snippet
that only generates one error before the ICE:

==
template void foo(T)
{
  X;
  X;
}

void X();
void X(int);

void bar()
{
  foo(0);
}
==

PR62207.cc: In function 'void foo(T)':
PR62207.cc:3:3: error: 'X' was not declared in this scope
   X;
   ^
PR62207.cc: In instantiation of 'void foo(T) [with T = int]':
PR62207.cc:12:8:   required from here
PR62207.cc:4:3: internal compiler error: tree check: expected tree that
contains 'decl minimal' structure, have 'overload' in tsubst_copy, at
cp/pt.c:14628
   X;
   ^
0x1029944 tree_contains_struct_check_failed(tree_node const*,
tree_node_structure_enum, char const*, int, char const*)
../../gcc/gcc/tree.c:10031
0x7b04b6 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
../../gcc/gcc/tree.h:3197
0x7b04b6 tsubst_copy
../../gcc/gcc/cp/pt.c:14628
0x7b5fc5 tsubst_copy
../../gcc/gcc/cp/pt.c:14483
0x7b5fc5 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
../../gcc/gcc/cp/pt.c:17806
0x7a6128 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/gcc/cp/pt.c:16521
0x7a4d1b tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/gcc/cp/pt.c:15785
0x7a4327 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/gcc/cp/pt.c:15998
0x7a1d90 instantiate_decl(tree_node*, bool, bool)
../../gcc/gcc/cp/pt.c:22963
0x7e33fb instantiate_pending_templates(int)
../../gcc/gcc/cp/pt.c:23084
0x6ca018 c_parse_final_cleanups()
../../gcc/gcc/cp/decl2.c:4511
Please submit a full bug report, [etc.]

This is a regression that appeared in GCC 5.1.0.

[Bug sanitizer/80973] New: ICE with lambda and -fsanitize=undefined

2017-06-04 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80973

Bug ID: 80973
   Summary: ICE with lambda and -fsanitize=undefined
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: sanitizer
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at 
gcc dot gnu.org
  Target Milestone: ---

The testcase g++.dg/cpp1y/pr77739.C triggers an ICE when compiled
with -std=c++1y -fsanitize=undefined since GCC 4.9.0:

pr77739.C: In member function 'auto B::g(Args&& ...) [with Args = {A, const
char (&)[1]}]':
pr77739.C:10:36: error: invalid offset operand in MEM_REF
   template  auto g(Args &&... p1) {
^
MEM[(struct __lambda0 &) + UBSAN_NULL (0, 2B, 8);, 0];

MEM[(struct __lambda0 &) + UBSAN_NULL (0, 2B, 8);, 0].__p1#1 = *p1#1;
pr77739.C:10:36: internal compiler error: verify_gimple failed
0xdb728d verify_gimple_in_seq(gimple*)
../../gcc/gcc/tree-cfg.c:4954
0xb0f08d gimplify_body(tree_node*, bool)
../../gcc/gcc/gimplify.c:12562
0xb0f3f4 gimplify_function_tree(tree_node*)
../../gcc/gcc/gimplify.c:12652
0x9720e7 cgraph_node::analyze()
../../gcc/gcc/cgraphunit.c:665
0x974f79 analyze_functions
../../gcc/gcc/cgraphunit.c:1126
0x976182 symbol_table::finalize_compilation_unit()
../../gcc/gcc/cgraphunit.c:2611
Please submit a full bug report, [etc.]

[Bug c++/80972] New: [7/8 Regression] ICE with alignas and __attribute__((packed))

2017-06-04 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80972

Bug ID: 80972
   Summary: [7/8 Regression] ICE with alignas and
__attribute__((packed))
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The testcase g++.dg/torture/pr80334.C triggers an ICE when compiled
with -std=c++1z since GCC 7.1.0. Here's an even shorter version:

==
struct A { alignas(2) char c; };
struct B { A a; } __attribute__((packed));

A a = B().a;
==

bug.cc:4:11: internal compiler error: in build_over_call, at cp/call.c:7989
 A a = B().a;
   ^
0x5fd0b5 build_over_call
../../gcc/gcc/cp/call.c:7986
0x5fdbbe build_new_method_call_1
../../gcc/gcc/cp/call.c:8823
0x5fdbbe build_new_method_call(tree_node*, tree_node*, vec**, tree_node*, int, tree_node**, int)
../../gcc/gcc/cp/call.c:8892
0x5ff039 build_special_member_call(tree_node*, tree_node*, vec**, tree_node*, int, int)
../../gcc/gcc/cp/call.c:8421
0x671255 ocp_convert(tree_node*, tree_node*, int, int, int)
../../gcc/gcc/cp/cvt.c:893
0x6eb2b5 expand_default_init
../../gcc/gcc/cp/init.c:1788
0x6eb2b5 expand_aggr_init_1
../../gcc/gcc/cp/init.c:1967
0x6eba59 build_aggr_init(tree_node*, tree_node*, int, int)
../../gcc/gcc/cp/init.c:1705
0x687faf build_aggr_init_full_exprs
../../gcc/gcc/cp/decl.c:6127
0x687faf check_initializer
../../gcc/gcc/cp/decl.c:6275
0x6a91dc cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
../../gcc/gcc/cp/decl.c:6994
0x74f3e3 cp_parser_init_declarator
../../gcc/gcc/cp/parser.c:19389
0x76e92c cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:12800
0x76f6c5 cp_parser_block_declaration
../../gcc/gcc/cp/parser.c:12625
0x741b74 cp_parser_declaration
../../gcc/gcc/cp/parser.c:12523
0x77753b cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:12399
0x77781a cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4364
0x77781a c_parse_file()
../../gcc/gcc/cp/parser.c:38475
0x8b9066 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.c:1104
Please submit a full bug report, [etc.]

[Bug c++/80971] New: [7/8 Regression] ICE with 'if constexpr' in template function

2017-06-04 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80971

Bug ID: 80971
   Summary: [7/8 Regression] ICE with 'if constexpr' in template
function
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following valid code snippet (compiled with -std=c++1z)
triggers an ICE since GCC 7.1.0:

==
struct A
{
  constexpr operator bool() const { return true; }
};

template bool foo()
{
  if constexpr (A())
return false;
  return true;
}
==

bug.cc: In function 'bool foo()':
bug.cc:8:20: internal compiler error: unexpected expression 'A()' of kind
cast_expr
   if constexpr (A())
^
0x6461c7 cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:4592
0x649557 cxx_eval_outermost_constant_expr
../../gcc/gcc/cp/constexpr.c:4652
0x7fca49 finish_if_stmt_cond(tree_node*, tree_node*)
../../gcc/gcc/cp/semantics.c:736
0x74552c cp_parser_selection_statement
../../gcc/gcc/cp/parser.c:11172
0x74552c cp_parser_statement
../../gcc/gcc/cp/parser.c:10583
0x745fbd cp_parser_statement_seq_opt
../../gcc/gcc/cp/parser.c:11054
0x74608f cp_parser_compound_statement
../../gcc/gcc/cp/parser.c:11008
0x760853 cp_parser_function_body
../../gcc/gcc/cp/parser.c:21445
0x760853 cp_parser_ctor_initializer_opt_and_function_body
../../gcc/gcc/cp/parser.c:21483
0x765e61 cp_parser_function_definition_after_declarator
../../gcc/gcc/cp/parser.c:26290
0x74f8bd cp_parser_function_definition_from_specifiers_and_declarator
../../gcc/gcc/cp/parser.c:26202
0x74f8bd cp_parser_init_declarator
../../gcc/gcc/cp/parser.c:19168
0x74fe3a cp_parser_single_declaration
../../gcc/gcc/cp/parser.c:26748
0x76910c cp_parser_template_declaration_after_parameters
../../gcc/gcc/cp/parser.c:26352
0x768d94 cp_parser_explicit_template_declaration
../../gcc/gcc/cp/parser.c:26587
0x768d94 cp_parser_template_declaration_after_export
../../gcc/gcc/cp/parser.c:26606
0x741c79 cp_parser_declaration
../../gcc/gcc/cp/parser.c:12472
0x77753b cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:12399
0x77781a cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4364
0x77781a c_parse_file()
../../gcc/gcc/cp/parser.c:38475
Please submit a full bug report, [etc.]

[Bug c/35443] [4.2/4.3/4.4 regression] Completely broken diagnostic with bind_expr

2017-05-09 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35443
Bug 35443 depends on bug 35441, which changed state.

Bug 35441 Summary: pretty-printer cannot handle some expressions
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35441

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

[Bug c/35442] [4.2/4.3/4.4 Regression] Completely broken diagnostic with view_convert_expr

2017-05-09 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35442
Bug 35442 depends on bug 35441, which changed state.

Bug 35441 Summary: pretty-printer cannot handle some expressions
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35441

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

[Bug c/35742] [4.3 regression] Broken diagnostic: 'goto_expr' not supported by pp_c_expression

2017-05-09 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35742
Bug 35742 depends on bug 35441, which changed state.

Bug 35441 Summary: pretty-printer cannot handle some expressions
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35441

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

[Bug c/35441] pretty-printer cannot handle some expressions

2017-05-09 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35441

Volker Reichelt  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #12 from Volker Reichelt  ---
Fixed on trunk for GCC 8.

[Bug c/35441] pretty-printer cannot handle some expressions

2017-05-09 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35441

--- Comment #11 from Volker Reichelt  ---
Author: reichelt
Date: Tue May  9 19:09:22 2017
New Revision: 247810

URL: https://gcc.gnu.org/viewcvs?rev=247810&root=gcc&view=rev
Log:
PR c/35441
* c-pretty-print.c (c_pretty_printer::expression): Handle MAX_EXPR,
MIN_EXPR, EXACT_DIV_EXPR, RDIV_EXPR, LROTATE_EXPR, RROTATE_EXPR.
(c_pretty_printer::postfix_expression): Handle MAX_EXPR, MIN_EXPR.
(c_pretty_printer::multiplicative_expression): Handle EXACT_DIV_EXPR,
RDIV_EXPR.
(pp_c_shift_expression): Handle LROTATE_EXPR, RROTATE_EXPR.

* gcc.dg/pr35441.c: New test.


Added:
trunk/gcc/testsuite/gcc.dg/pr35441.c
Modified:
trunk/gcc/c-family/ChangeLog
trunk/gcc/c-family/c-pretty-print.c
trunk/gcc/testsuite/ChangeLog

[Bug translation/80280] Missing closing quote (%>) c/semantics.c and c/c-typeck.c

2017-05-07 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80280

--- Comment #4 from Volker Reichelt  ---
Author: reichelt
Date: Sun May  7 19:41:09 2017
New Revision: 247728

URL: https://gcc.gnu.org/viewcvs?rev=247728&root=gcc&view=rev
Log:
PR translation/80280
* call.c (print_z_candidate): Fix quoting.


Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/call.c

[Bug c++/79664] ICE with #pragma omp parallel in constexpr function

2017-05-07 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79664

Volker Reichelt  changed:

   What|Removed |Added

  Known to work||6.3.1, 7.1.0
   Target Milestone|--- |6.4
  Known to fail||5.1.0, 6.1.0, 6.3.0

[Bug c++/79681] [6 Regression] ICE with constexpr and bitfield

2017-05-07 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79681

Volker Reichelt  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
  Known to work||6.3.1
 Resolution|--- |FIXED
  Known to fail||5.1.0, 6.1.0, 6.3.0

--- Comment #10 from Volker Reichelt  ---
Fixed by Jakub's patch.

[Bug c++/79639] [6 Regression] ICE with -O and constexpr

2017-05-07 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79639

Volker Reichelt  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
  Known to work||6.3.1
 Resolution|--- |FIXED

--- Comment #7 from Volker Reichelt  ---
Fixed by Jakub's patch.

[Bug c++/79580] [5/6 Regression] ICE in nested_anon_class_index, at cp/mangle.c:1604

2017-04-04 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79580

Volker Reichelt  changed:

   What|Removed |Added

 CC||reichelt at gcc dot gnu.org

--- Comment #3 from Volker Reichelt  ---
*** Bug 58634 has been marked as a duplicate of this bug. ***

[Bug c++/58634] [c++11] ICE initializing static class member via an anonymous class

2017-04-04 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58634

Volker Reichelt  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #1 from Volker Reichelt  ---
Fixed with the patch for PR79580.

*** This bug has been marked as a duplicate of bug 79580 ***

[Bug c++/80296] Broken diagnostic 'unary_plus_expr' not supported by expression

2017-04-04 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80296

Volker Reichelt  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Volker Reichelt  ---
Fixed on trunk.

[Bug c++/80296] Broken diagnostic 'unary_plus_expr' not supported by expression

2017-04-04 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80296

--- Comment #3 from Volker Reichelt  ---
Author: reichelt
Date: Tue Apr  4 16:30:44 2017
New Revision: 246683

URL: https://gcc.gnu.org/viewcvs?rev=246683&root=gcc&view=rev
Log:
PR c++/80296
* cxx-pretty-print.c (cxx_pretty_printer::expression): Add
UNARY_PLUS_EXPR case.

* g++.dg/cpp0x/alias-decl-80296.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/alias-decl-80296.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cxx-pretty-print.c
trunk/gcc/testsuite/ChangeLog

[Bug c/35441] pretty-printer cannot handle some expressions

2017-04-03 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35441

--- Comment #10 from Volker Reichelt  ---
Patch at https://gcc.gnu.org/ml/gcc-patches/2017-03/msg00498.html

[Bug c++/80296] Broken diagnostic 'unary_plus_expr' not supported by expression

2017-04-03 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80296

--- Comment #2 from Volker Reichelt  ---
Patch at https://gcc.gnu.org/ml/gcc-patches/2017-04/msg00111.html

[Bug c++/80296] Broken diagnostic 'unary_plus_expr' not supported by expression

2017-04-03 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80296

Volker Reichelt  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2017-04-03
 Ever confirmed|0   |1

--- Comment #1 from Volker Reichelt  ---
I've got a patch.

[Bug c++/80296] New: Broken diagnostic 'unary_plus_expr' not supported by expression

2017-04-03 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80296

Bug ID: 80296
   Summary: Broken diagnostic 'unary_plus_expr' not supported by
expression
   Product: gcc
   Version: 7.0.1
Status: UNCONFIRMED
  Keywords: diagnostic
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

GCC gives a broken daignostic for the following invalid code snippet
since GCC 4.7.0:

=
template  struct A {};

template  using B = A<+N...>;

B b;
=

bug.cc:5:6: error: type/value mismatch at argument 1 in template parameter list
for 'template using B = A<#'unary_plus_expr' not supported by
expression#...>'
 B b;
  ^
bug.cc:5:6: note:   expected a constant of type 'int', got 'int'

[Bug c++/77339] [5/6/7 Regression] ICE on invalid C++ code on x86_64-linux-gnu: in cp_parser_type_name, at cp/parser.c:16532

2017-03-31 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77339

--- Comment #6 from Volker Reichelt  ---
*** Bug 58987 has been marked as a duplicate of this bug. ***

[Bug c++/58987] [5/6/7 Regression] ICE with template alias

2017-03-31 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58987

Volker Reichelt  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
  Known to work||7.0.1
 Resolution|--- |DUPLICATE

--- Comment #2 from Volker Reichelt  ---
Fixed with the patch for PR77339, so marking as duplicate.

*** This bug has been marked as a duplicate of bug 77339 ***

[Bug c++/80259] New: [5/6/7 Regression] ICE deleting friend function

2017-03-29 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80259

Bug ID: 80259
   Summary: [5/6/7 Regression] ICE deleting friend function
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following invalid code snippet triggers an ICE since GCC 5.1.0:


void foo() {}

struct A
{
  friend void foo() = delete;
};


bug.cc: In function 'void foo()':
bug.cc:1:6: internal compiler error: tree check: expected block, have
error_mark in lower_function_body, at gimple-low.c:98
 void foo() {}
  ^~~
0x100a3ec tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc/gcc/tree.c:9817
0x146eb3a tree_check(tree_node*, char const*, int, char const*, tree_code)
../../gcc/gcc/tree.h:3064
0x146eb3a lower_function_body
../../gcc/gcc/gimple-low.c:98
0x146eb3a execute
../../gcc/gcc/gimple-low.c:181
Please submit a full bug report [etc.]

[Bug c++/80240] cannot dynamic_cast variable to intmax_t from variable of type intmax_t

2017-03-28 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80240

Volker Reichelt  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||reichelt at gcc dot gnu.org
 Resolution|--- |INVALID

--- Comment #1 from Volker Reichelt  ---
The C++ standard says in [expr.dynamic.cast]:

1 The result of the expression dynamic_cast(v) is the result of converting
the expression v to type T. T shall be a pointer or reference to a complete
class type, or "pointer to cv void."

intmax_t is neither a pointer or reference and that's what the error message
says.
The compiler is correct, your code is broken.

[Bug c++/80244] New: [6/7 Regression] ICE with attribute in template alias

2017-03-28 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80244

Bug ID: 80244
   Summary: [6/7 Regression] ICE with attribute in template alias
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following code snippet triggers an ICE since GCC 6.1.0:

==
template struct A {};

template using B = A<__underlying_type(T) [[gnu::aligned(4)]]>;
==

bug.cc:3:67: internal compiler error: in layout_type, at stor-layout.c:2386
 template using B = A<__underlying_type(T) [[gnu::aligned(4)]]>;
   ^
0xd5a9bf layout_type(tree_node*)
../../gcc/gcc/stor-layout.c:2386
0x1027845 type_hash_canon(unsigned int, tree_node*)
../../gcc/gcc/tree.c:7131
0x1027d2d build_type_attribute_qual_variant(tree_node*, tree_node*, int)
../../gcc/gcc/tree.c:4875
0x7ce47d cp_build_type_attribute_variant(tree_node*, tree_node*)
../../gcc/gcc/cp/tree.c:4156
0x7dd9f2 strip_typedefs(tree_node*, bool*)
../../gcc/gcc/cp/tree.c:1580
0x6478ac canonicalize_type_argument
../../gcc/gcc/cp/pt.c:7331
0x68db53 coerce_template_parms
../../gcc/gcc/cp/pt.c:8128
0x6947ea lookup_template_class_1
../../gcc/gcc/cp/pt.c:8664
0x6947ea lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
../../gcc/gcc/cp/pt.c:9009
0x7a7a8d finish_template_type(tree_node*, tree_node*, int)
../../gcc/gcc/cp/semantics.c:3151
0x7308f4 cp_parser_template_id
../../gcc/gcc/cp/parser.c:15491
0x730b0f cp_parser_class_name
../../gcc/gcc/cp/parser.c:21949
0x72d572 cp_parser_qualifying_entity
../../gcc/gcc/cp/parser.c:6285
0x72d572 cp_parser_nested_name_specifier_opt
../../gcc/gcc/cp/parser.c:5971
0x732b23 cp_parser_simple_type_specifier
../../gcc/gcc/cp/parser.c:16822
0x7208ad cp_parser_type_specifier
../../gcc/gcc/cp/parser.c:16495
0x72f1e2 cp_parser_type_specifier_seq
../../gcc/gcc/cp/parser.c:20777
0x724e61 cp_parser_type_id_1
../../gcc/gcc/cp/parser.c:20623
0x72c4f0 cp_parser_type_id
../../gcc/gcc/cp/parser.c:20693
0x72c4f0 cp_parser_alias_declaration
../../gcc/gcc/cp/parser.c:18589
Please submit a full bug report, [etc.]

In GCC 5 and before the code was accepted.

[Bug c++/80241] New: [5/6/7 Regression] Broken error message + ICE with invalid attribute

2017-03-28 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80241

Bug ID: 80241
   Summary: [5/6/7 Regression] Broken error message  + ICE with
invalid attribute
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: diagnostic, ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following invalid code snippet triggers a broken error message
followed by an ICE since GCC 5.2.0:

=
template  struct A
{
  [[gnu::aligned (alignof(A))...]] char c;
};

A a;
=

bug.cc:3:30: error: expansion pattern '#'tree_list' not supported by
dump_expr#' contains no argument packs
   [[gnu::aligned (alignof(A))...]] char c;
  ^~~
bug.cc:3:41: internal compiler error: tree check: expected tree_list, have
error_mark in is_late_template_attribute, at cp/decl2.c:1119
   [[gnu::aligned (alignof(A))...]] char c;
 ^
0x100872c tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc/gcc/tree.c:9817
0x6e946d tree_check(tree_node*, char const*, int, char const*, tree_code)
../../gcc/gcc/tree.h:3064
0x6e946d is_late_template_attribute
../../gcc/gcc/cp/decl2.c:1119
0x6e946d splice_template_attributes
../../gcc/gcc/cp/decl2.c:1179
0x6e946d save_template_attributes
../../gcc/gcc/cp/decl2.c:1205
0x6e946d cplus_decl_attributes(tree_node**, tree_node*, int)
../../gcc/gcc/cp/decl2.c:1420
0x6f036d grokfield(cp_declarator const*, cp_decl_specifier_seq*, tree_node*,
bool, tree_node*, tree_node*)
../../gcc/gcc/cp/decl2.c:951
0x71da83 cp_parser_member_declaration
../../gcc/gcc/cp/parser.c:23392
0x71e63a cp_parser_member_specification_opt
../../gcc/gcc/cp/parser.c:22941
0x71e63a cp_parser_class_specifier_1
../../gcc/gcc/cp/parser.c:22094
0x720bf1 cp_parser_class_specifier
../../gcc/gcc/cp/parser.c:22346
0x720bf1 cp_parser_type_specifier
../../gcc/gcc/cp/parser.c:16419
0x721ada cp_parser_decl_specifier_seq
../../gcc/gcc/cp/parser.c:13326
0x71d275 cp_parser_single_declaration
../../gcc/gcc/cp/parser.c:26621
0x73f19c cp_parser_template_declaration_after_parameters
../../gcc/gcc/cp/parser.c:26315
0x73ee2c cp_parser_explicit_template_declaration
../../gcc/gcc/cp/parser.c:26550
0x73ee2c cp_parser_template_declaration_after_export
../../gcc/gcc/cp/parser.c:26569
0x746fa9 cp_parser_declaration
../../gcc/gcc/cp/parser.c:12445
0x748abb cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:12372
0x748d9a cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4366
Please submit a full bug report, [etc.]

[Bug c++/80145] New: [c++1y] ICE after failed return type deduction

2017-03-21 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80145

Bug ID: 80145
   Summary: [c++1y] ICE after failed return type deduction
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Keywords: error-recovery, ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following invalid code snippet (compiled with -std=c++1y)
triggers an ICE since GCC 4.8.0:


auto* foo() { return 0; }
auto* foo();


bug.cc: In function 'auto* foo()':
bug.cc:1:22: error: unable to deduce 'auto*' from '0'
 auto* foo() { return 0; }
  ^
bug.cc:1:22: note:   mismatched types 'auto*' and 'int'
bug.cc: At global scope:
bug.cc:2:11: internal compiler error: in merge_types, at cp/typeck.c:768
 auto* foo();
   ^
0x75ae68 merge_types(tree_node*, tree_node*)
../../gcc/gcc/cp/typeck.c:768
0x75a2e5 merge_types(tree_node*, tree_node*)
../../gcc/gcc/cp/typeck.c:835
0x6236e8 duplicate_decls(tree_node*, tree_node*, bool)
../../gcc/gcc/cp/decl.c:2144
0x808108 pushdecl_maybe_friend_1
../../gcc/gcc/cp/name-lookup.c:835
0x808108 pushdecl_maybe_friend(tree_node*, bool)
../../gcc/gcc/cp/name-lookup.c:1352
0x6379c5 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
../../gcc/gcc/cp/decl.c:5137
0x71c477 cp_parser_init_declarator
../../gcc/gcc/cp/parser.c:19251
0x740a9c cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:12773
0x741835 cp_parser_block_declaration
../../gcc/gcc/cp/parser.c:12598
0x746c44 cp_parser_declaration
../../gcc/gcc/cp/parser.c:12496
0x74886b cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:12372
0x748b4a cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4366
0x748b4a c_parse_file()
../../gcc/gcc/cp/parser.c:38423
0x8a8ec3 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.c:1107
Please submit a full bug report, [etc.]

[Bug c++/80141] New: ICE with pragma omp declare

2017-03-21 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80141

Bug ID: 80141
   Summary: ICE with pragma omp declare
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Keywords: ice-on-valid-code, openmp
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following valid code snippet (compiled with -fopenmp)
triggers an ICE since GCC 4.9.0:


#pragma omp declare simd aligned (p : 2 && 2)
template void foo(int* p);


bug.cc:2:46: internal compiler error: in cxx_eval_logical_expression, at
cp/constexpr.c:2528
 #pragma omp declare simd aligned (p : 2 && 2)
  ^
0x842cac cxx_eval_logical_expression
../../gcc/gcc/cp/constexpr.c:2528
0x83dd60 cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:4283
0x8e cxx_eval_outermost_constant_expr
../../gcc/gcc/cp/constexpr.c:4637
0x847756 maybe_constant_value(tree_node*, tree_node*)
../../gcc/gcc/cp/constexpr.c:4852
0x7bb3c5 finish_omp_clauses(tree_node*, c_omp_region_type)
../../gcc/gcc/cp/semantics.c:6589
0x735350 cp_parser_omp_all_clauses
../../gcc/gcc/cp/parser.c:33479
0x724112 cp_parser_late_parsing_omp_declare_simd
../../gcc/gcc/cp/parser.c:36687
0x724112 cp_parser_late_return_type_opt
../../gcc/gcc/cp/parser.c:20550
0x724112 cp_parser_direct_declarator
../../gcc/gcc/cp/parser.c:19697
0x724112 cp_parser_declarator
../../gcc/gcc/cp/parser.c:19517
0x71c15c cp_parser_init_declarator
../../gcc/gcc/cp/parser.c:19042
0x71d1ea cp_parser_single_declaration
../../gcc/gcc/cp/parser.c:26711
0x73ef5c cp_parser_template_declaration_after_parameters
../../gcc/gcc/cp/parser.c:26315
0x73ebec cp_parser_explicit_template_declaration
../../gcc/gcc/cp/parser.c:26550
0x73ebec cp_parser_template_declaration_after_export
../../gcc/gcc/cp/parser.c:26569
0x746d59 cp_parser_declaration
../../gcc/gcc/cp/parser.c:12445
0x748097 cp_parser_omp_declare_simd
../../gcc/gcc/cp/parser.c:36575
0x748097 cp_parser_omp_declare
../../gcc/gcc/cp/parser.c:37242
0x71815d cp_parser_pragma
../../gcc/gcc/cp/parser.c:38188
0x7488db cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:12367
Please submit a full bug report, [etc.]

[Bug c++/80059] [7 Regression] ICE with invalid noexcept for __transaction_atomic

2017-03-20 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80059

--- Comment #11 from Volker Reichelt  ---
Hi Marek, thanks for the fix!
However, the ChangeLog entry is wrong.

In the final version you didn't call instantiate_non_dependent_expr_sfinae,
but instantiate_non_dependent_expr instead.

Would you mind fixing that? Thanks!

[Bug bootstrap/28561] Broken dependencies

2017-03-20 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28561

Volker Reichelt  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Volker Reichelt  ---
This is not an issue anymore.

[Bug c++/80096] New: [c++1z] ICE with auto template parameter

2017-03-19 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80096

Bug ID: 80096
   Summary: [c++1z] ICE with auto template parameter
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following valid code snippet triggers an ICE on trunk
(when compiled with -std=c++1z):

=
template struct A
{
  template struct B {};
};

A<0> a;
=

bug.cc: In instantiation of 'struct A<0>':
bug.cc:6:6:   required from here
bug.cc:3:24: internal compiler error: in tsubst, at cp/pt.c:13524
   template struct B {};
^
0x67936b tsubst(tree_node*, tree_node*, int, tree_node*)
../../gcc/gcc/cp/pt.c:13524
0x676ef6 tsubst(tree_node*, tree_node*, int, tree_node*)
../../gcc/gcc/cp/pt.c:13394
0x663db0 tsubst_copy
../../gcc/gcc/cp/pt.c:14963
0x68a9cf tsubst_copy
../../gcc/gcc/cp/pt.c:14426
0x68a9cf tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
../../gcc/gcc/cp/pt.c:17920
0x66a140 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/gcc/cp/pt.c:16458
0x67c626 tsubst_template_args
../../gcc/gcc/cp/pt.c:11697
0x699474 tsubst_aggr_type
../../gcc/gcc/cp/pt.c:11899
0x676aaa tsubst(tree_node*, tree_node*, int, tree_node*)
../../gcc/gcc/cp/pt.c:13404
0x6962e2 lookup_template_class_1
../../gcc/gcc/cp/pt.c:8738
0x6962e2 lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
../../gcc/gcc/cp/pt.c:9009
0x699499 tsubst_aggr_type
../../gcc/gcc/cp/pt.c:11905
0x676aaa tsubst(tree_node*, tree_node*, int, tree_node*)
../../gcc/gcc/cp/pt.c:13404
0x673ac8 tsubst_decl
../../gcc/gcc/cp/pt.c:12114
0x676ce7 tsubst(tree_node*, tree_node*, int, tree_node*)
../../gcc/gcc/cp/pt.c:13322
0x6ac108 instantiate_class_template_1
../../gcc/gcc/cp/pt.c:10514
0x6ac108 instantiate_class_template(tree_node*)
../../gcc/gcc/cp/pt.c:10798
0x750ca6 complete_type(tree_node*)
../../gcc/gcc/cp/typeck.c:133
0x610199 start_decl_1(tree_node*, bool)
../../gcc/gcc/cp/decl.c:5208
0x637bbf start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
../../gcc/gcc/cp/decl.c:5171
Please submit a full bug report, [etc.]

Btw, clang 4.0.0 accepts the code.

[Bug c++/79549] [c++1z] ICE in tsubst, at cp/pt.c:13474 with partial specialization of auto... template parameter pack

2017-03-19 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79549

Volker Reichelt  changed:

   What|Removed |Added

 CC||barry.revzin at gmail dot com

--- Comment #9 from Volker Reichelt  ---
*** Bug 79138 has been marked as a duplicate of this bug. ***

[Bug c++/79138] ICE when trying to do template auto

2017-03-19 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79138

Volker Reichelt  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 CC||reichelt at gcc dot gnu.org
 Resolution|--- |DUPLICATE

--- Comment #2 from Volker Reichelt  ---
This was fixed with Jason's patch for PR79549, so marking it as duplicate.
Btw, clang 4.0.0 accepts the code.

*** This bug has been marked as a duplicate of bug 79549 ***

[Bug c++/80095] New: [5/6/7 Regression] ICE with this pointer in NSDMI

2017-03-18 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80095

Bug ID: 80095
   Summary: [5/6/7 Regression] ICE with this pointer in NSDMI
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following valid code snippet triggers an ICE since GCC 5.1.0
(when compiled with -std=c++1y):

===
struct A
{
  void* p = this;
};

void foo()
{
  const A& a = A{};
}
===

bug.cc: In function 'void foo()':
bug.cc:8:18: internal compiler error: in gimplify_expr, at gimplify.c:11957
   const A& a = A{};
  ^
0xaee4e1 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:11957
0xaead60 gimplify_addr_expr
../../gcc/gcc/gimplify.c:5859
0xaead60 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:11245
0xafd43b gimplify_modify_expr
../../gcc/gcc/gimplify.c:5457
0xaebd4c gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:11198
0xaeeca8 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:6478
0xaeb2fa gimplify_cleanup_point_expr
../../gcc/gcc/gimplify.c:6230
0xaeb2fa gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:11574
0xaeeca8 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:6478
0xaef8fd gimplify_compound_expr
../../gcc/gcc/gimplify.c:5715
0xaf60cf gimplify_modify_expr_rhs
../../gcc/gcc/gimplify.c:5069
0xafd2f1 gimplify_modify_expr
../../gcc/gcc/gimplify.c:5417
0xaebd4c gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:11198
0xaeeca8 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:6478
0xaeb2fa gimplify_cleanup_point_expr
../../gcc/gcc/gimplify.c:6230
0xaeb2fa gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:11574
0xaeeca8 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:6478
0xaea51b gimplify_statement_list
../../gcc/gcc/gimplify.c:1716
0xaea51b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:11626
0xaeeca8 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:6478
Please submit a full bug report, [etc.]

[Bug c++/80073] New: [7 Regression] ICE with virtual base

2017-03-16 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80073

Bug ID: 80073
   Summary: [7 Regression] ICE with virtual base
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following valid code snippet (compiled with -std=c++1z) triggers an ICE on
trunk:


struct A {};

struct B : virtual A {};

struct C : B {} c {};


bug.cc:5:20: internal compiler error: in process_init_constructor_record, at
cp/typeck2.c:1355
 struct C : B {} c {};
^
0x6f1c7a process_init_constructor_record
../../gcc/gcc/cp/typeck2.c:1355
0x6f1c7a process_init_constructor
../../gcc/gcc/cp/typeck2.c:1614
0x6f1c7a digest_init_r
../../gcc/gcc/cp/typeck2.c:1125
0x6f3472 digest_init_flags(tree_node*, tree_node*, int, int)
../../gcc/gcc/cp/typeck2.c:1170
0x6f3472 store_init_value(tree_node*, tree_node*, vec**, int)
../../gcc/gcc/cp/typeck2.c:797
0x6504ab check_initializer
../../gcc/gcc/cp/decl.c:6358
0x67a75c cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
../../gcc/gcc/cp/decl.c:7023
0x77822c cp_parser_init_declarator
../../gcc/gcc/cp/parser.c:19383
0x778a6c cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:12766
0x779845 cp_parser_block_declaration
../../gcc/gcc/cp/parser.c:12592
0x752527 cp_parser_declaration
../../gcc/gcc/cp/parser.c:12489
0x782c8b cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:12365
0x782f6a cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4369
0x782f6a c_parse_file()
../../gcc/gcc/cp/parser.c:38356
0x8df643 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.c:1107
Please submit a full bug report, [etc.]

[Bug c++/80059] New: [7 Regression] ICE with invalid noexcept for __transaction_atomic

2017-03-15 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80059

Bug ID: 80059
   Summary: [7 Regression] ICE with invalid noexcept for
__transaction_atomic
   Product: gcc
   Version: 7.0.1
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code, trans-mem
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following invalid code snippet (compiled with -fgnu-tm) triggers
an ICE on trunk:

=
template int foo(bool b)
{
  return __transaction_atomic noexcept(b) (0);
}

void bar()
{
  foo(true);
}
=

bug.cc: In function 'int foo(bool)':
bug.cc:3:45: internal compiler error: unexpected expression 'b' of kind
implicit_conv_expr
   return __transaction_atomic noexcept(b) (0);
 ^
0x83f890 cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:4575
0x842ece cxx_eval_outermost_constant_expr
../../gcc/gcc/cp/constexpr.c:4633
0x776f2a build_must_not_throw_expr(tree_node*, tree_node*)
../../gcc/gcc/cp/except.c:274
0x7ac6ff build_transaction_expr(unsigned int, tree_node*, int, tree_node*)
../../gcc/gcc/cp/semantics.c:8747
0x72628f cp_parser_transaction_expression
../../gcc/gcc/cp/parser.c:37871
0x72628f cp_parser_unary_expression
../../gcc/gcc/cp/parser.c:7895
0x726c93 cp_parser_cast_expression
../../gcc/gcc/cp/parser.c:8780
0x7273e7 cp_parser_binary_expression
../../gcc/gcc/cp/parser.c:8881
0x727cb4 cp_parser_assignment_expression
../../gcc/gcc/cp/parser.c:9168
0x72b9c8 cp_parser_expression
../../gcc/gcc/cp/parser.c:9337
0x719f9a cp_parser_jump_statement
../../gcc/gcc/cp/parser.c:12147
0x719f9a cp_parser_statement
../../gcc/gcc/cp/parser.c:10581
0x71a84d cp_parser_statement_seq_opt
../../gcc/gcc/cp/parser.c:11027
0x71a91f cp_parser_compound_statement
../../gcc/gcc/cp/parser.c:10981
0x71aab3 cp_parser_function_body
../../gcc/gcc/cp/parser.c:21428
0x71aab3 cp_parser_ctor_initializer_opt_and_function_body
../../gcc/gcc/cp/parser.c:21466
0x71b331 cp_parser_function_definition_after_declarator
../../gcc/gcc/cp/parser.c:26253
0x71c01d cp_parser_function_definition_from_specifiers_and_declarator
../../gcc/gcc/cp/parser.c:26165
0x71c01d cp_parser_init_declarator
../../gcc/gcc/cp/parser.c:19155
0x71c5ca cp_parser_single_declaration
../../gcc/gcc/cp/parser.c:26711
Please submit a full bug report, [etc.]

This is a recent regression introduced between 2017-03-02 and 2017-03-06.

[Bug c++/80043] New: [6/7 Regression] ICE with pointer-to-member-function and -fpermissive

2017-03-14 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80043

Bug ID: 80043
   Summary: [6/7 Regression] ICE with pointer-to-member-function
and -fpermissive
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following code snippet (compiled with -fpermissive) triggers an ICE
since GCC 6.1.0:

=
struct A
{
  template void foo()
  {
void (A::* fp)();
fp = A::foo<0>;
  }
};

void bar()
{
  A().foo<0>();
}
=

bug.cc: In instantiation of 'void A::foo() [with int  = 0]':
bug.cc:12:14:   required from here
bug.cc:6:8: warning: assuming pointer to member 'void A::foo() [with int
 = 0]' [-fpermissive]
 fp = A::foo<0>;
 ~~~^~~
bug.cc:6:8: note: (a pointer to member can only be formed with '&A::foo<0>')
bug.cc:6:5: internal compiler error: in finish_expr_stmt, at cp/semantics.c:677
 fp = A::foo<0>;
 ^~
0x7affd0 finish_expr_stmt(tree_node*)
../../gcc-6.1.0/gcc/cp/semantics.c:677
0x683322 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc-6.1.0/gcc/cp/pt.c:15121
0x68089c tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc-6.1.0/gcc/cp/pt.c:15103
0x681662 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc-6.1.0/gcc/cp/pt.c:15289
0x6c105e instantiate_decl(tree_node*, int, bool)
../../gcc-6.1.0/gcc/cp/pt.c:22013
0x6c7e3b instantiate_pending_templates(int)
../../gcc-6.1.0/gcc/cp/pt.c:22130
0x708d61 c_parse_final_cleanups()
../../gcc-6.1.0/gcc/cp/decl2.c:4599
Please submit a full bug report, [etc.]

[Bug c++/80014] New: [6/7 Regression] Caret missing in error message

2017-03-12 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80014

Bug ID: 80014
   Summary: [6/7 Regression] Caret missing in error message
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: diagnostic
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The caret is missing in the error message for testcase
gcc/testsuite/g++.dg/rtti/typeid6.C
since GCC 6.1.0:

gcc-6-branch:
typeid6.C: In function 'void foo()':
typeid6.C:10:3: error: no match for 'operator!' (operand type is 'const
std::type_info')
   !typeid(void); // { dg-error "!typeid\\(void\\)|candidate is" }

typeid6.C:10:3: note: candidate: operator!(bool) 
typeid6.C:10:3: note:   no known conversion for argument 1 from 'const
std::type_info' to 'bool'

trunk:
typeid6.C: In function 'void foo()':
typeid6.C:10:3: error: no match for 'operator!' (operand type is 'const
std::type_info')
   !typeid(void); // { dg-error "!typeid\\(void\\)|candidate is" }
typeid6.C:10:3: note: candidate: operator!(bool) 
typeid6.C:10:3: note:   no known conversion for argument 1 from 'const
std::type_info' to 'bool'

Note that the location information is at least partially available since the
line and column number in the error message are correct.

[Bug c/35441] pretty-printer cannot handle some expressions

2017-03-09 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35441

Volker Reichelt  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |reichelt at gcc dot 
gnu.org

[Bug c++/28254] ICE with invalid class$

2017-03-06 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28254

Volker Reichelt  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Volker Reichelt  ---
Fixed in GCC 7, because Java was removed.
The code now produces a proper error message.

[Bug c++/58987] [5/6/7 Regression] ICE with template alias

2017-03-03 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58987

Volker Reichelt  changed:

   What|Removed |Added

   Keywords|ice-on-valid-code   |ice-on-invalid-code
  Known to work||4.7.0, 4.7.2
Summary|[c++11] ICE with template   |[5/6/7 Regression] ICE with
   |alias   |template alias

--- Comment #1 from Volker Reichelt  ---
Although the default template parameter is not used here, the code is probably
ill-formed, so that we actually have a regression here.

This bug is related to PR77339.

[Bug c++/79822] New: [7 Regression] ICE with void statement expression

2017-03-02 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79822

Bug ID: 79822
   Summary: [7 Regression] ICE with void statement expression
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following invalid code snippet triggers an ICE on trunk:

==
bool foo()
{
  return ({ ; }) && false;
}
==

bug.cc: In function 'bool foo()':
bug.cc:3:18: internal compiler error: Segmentation fault
   return ({ ; }) && false;
  ^~
0xd5fe0f crash_signal
../../gcc/gcc/toplev.c:337
0x836879 reduced_constant_expression_p(tree_node*)
../../gcc/gcc/cp/constexpr.c:1708
0x8369d4 verify_constant
../../gcc/gcc/cp/constexpr.c:1741
0x8425f7 cxx_eval_outermost_constant_expr
../../gcc/gcc/cp/constexpr.c:4618
0x845906 maybe_constant_value(tree_node*, tree_node*)
../../gcc/gcc/cp/constexpr.c:4830
0x8206aa cp_fully_fold(tree_node*)
../../gcc/gcc/cp/cp-gimplify.c:1963
0x727267 cp_parser_binary_expression
../../gcc/gcc/cp/parser.c:8936
0x7276c4 cp_parser_assignment_expression
../../gcc/gcc/cp/parser.c:9168
0x72b3d8 cp_parser_expression
../../gcc/gcc/cp/parser.c:9337
0x7199aa cp_parser_jump_statement
../../gcc/gcc/cp/parser.c:12147
0x7199aa cp_parser_statement
../../gcc/gcc/cp/parser.c:10581
0x71a25d cp_parser_statement_seq_opt
../../gcc/gcc/cp/parser.c:11027
0x71a32f cp_parser_compound_statement
../../gcc/gcc/cp/parser.c:10981
0x71a4c3 cp_parser_function_body
../../gcc/gcc/cp/parser.c:21428
0x71a4c3 cp_parser_ctor_initializer_opt_and_function_body
../../gcc/gcc/cp/parser.c:21466
0x71ad41 cp_parser_function_definition_after_declarator
../../gcc/gcc/cp/parser.c:26253
0x71ba2d cp_parser_function_definition_from_specifiers_and_declarator
../../gcc/gcc/cp/parser.c:26165
0x71ba2d cp_parser_init_declarator
../../gcc/gcc/cp/parser.c:19155
0x73f6cc cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:12773
0x740475 cp_parser_block_declaration
../../gcc/gcc/cp/parser.c:12598
Please submit a full bug report, [etc.]

[Bug sanitizer/79783] [7 Regression] ICE on valid C++ with -fsanitize=address

2017-03-01 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79783

Volker Reichelt  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 CC||reichelt at gcc dot gnu.org
  Known to work||6.1.0
 Ever confirmed|0   |1
  Known to fail||7.0.1

--- Comment #1 from Volker Reichelt  ---
Even simpler testcase, crashes with -O -fsanitize=address -fno-tree-dce :

=
struct A
{
  static void foo(const char&) {}
};

struct B
{
  B() { A::foo(char()); }
};

struct C
{
  virtual void bar() const { B b; }
};

C c;
=

[Bug c++/79797] New: [5/6/7 Regression] ICE with NSDMI, this pointer and constexpr

2017-03-01 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79797

Bug ID: 79797
   Summary: [5/6/7 Regression] ICE with NSDMI, this pointer  and
constexpr
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following (valid?) code snippet (compiled with -std=c++1y) triggers an ICE
since GCC 5.1.0:

=
struct A
{
  A* x[1]{(A*)this};
};

constexpr A a{};
=

bug.cc:6:15: internal compiler error: in cxx_eval_constant_expression, at
cp/constexpr.c:4477
 constexpr A a{};
   ^
0x83eb95 cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:4477
0x83bad3 cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:4119
0x83d1ca cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:4343
0x83ceb3 cxx_eval_bare_aggregate
../../gcc/gcc/cp/constexpr.c:2686
0x83ceb3 cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:4316
0x83ceb3 cxx_eval_bare_aggregate
../../gcc/gcc/cp/constexpr.c:2686
0x83ceb3 cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:4316
0x8422fe cxx_eval_outermost_constant_expr
../../gcc/gcc/cp/constexpr.c:4615
0x6b6862 store_init_value(tree_node*, tree_node*, vec**, int)
../../gcc/gcc/cp/typeck2.c:817
0x61242b check_initializer
../../gcc/gcc/cp/decl.c:6365
0x63cc3c cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
../../gcc/gcc/cp/decl.c:7037
0x71b333 cp_parser_init_declarator
../../gcc/gcc/cp/parser.c:19375
0x73f3ec cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:12772
0x740195 cp_parser_block_declaration
../../gcc/gcc/cp/parser.c:12597
0x7455a4 cp_parser_declaration
../../gcc/gcc/cp/parser.c:12495
0x7471cb cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:12371
0x7474aa cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4366
0x7474aa c_parse_file()
../../gcc/gcc/cp/parser.c:38418
0x8a6ad3 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.c:1107
Please submit a full bug report, [etc.]

The code was rejected with a "sorry" message in GCC 4.8 / 4.9:

bug.cc:6:15:   in constexpr expansion of 'A()'
bug.cc:6:15: sorry, unimplemented: use of the value of the object being
constructed in a constant expression
 constexpr A a{};

[Bug c++/79796] New: [5/6/7 Regression] ICE with NSDMI and this pointer

2017-03-01 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79796

Bug ID: 79796
   Summary: [5/6/7 Regression] ICE with NSDMI and this pointer
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following valid code snippet (compiled with -std=c++1y) triggers
an ICE since GCC 5.1.0:

=
struct A
{
  A* p = this;
};

void foo()
{
  A a;
  a = A({});
}
=

bug.cc: In function 'void foo()':
bug.cc:9:5: internal compiler error: in gimplify_expr, at gimplify.c:11950
   a = A({});
   ~~^~~
0xaeacfc gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:11950
0xae80e0 gimplify_addr_expr
../../gcc/gcc/gimplify.c:5859
0xae80e0 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:11238
0xaf17c0 gimplify_init_ctor_preeval
../../gcc/gcc/gimplify.c:4241
0xaf1778 gimplify_init_ctor_preeval
../../gcc/gcc/gimplify.c:4227
0xaf225c gimplify_init_constructor
../../gcc/gcc/gimplify.c:4796
0xaf3096 gimplify_modify_expr_rhs
../../gcc/gcc/gimplify.c:5082
0xaf9dd0 gimplify_modify_expr
../../gcc/gcc/gimplify.c:5417
0xae897c gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:11191
0xaeb8d8 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:6478
0xae7a7a gimplify_cleanup_point_expr
../../gcc/gcc/gimplify.c:6230
0xae7a7a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:11567
0xaeb8d8 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:6478
0xae71cb gimplify_statement_list
../../gcc/gcc/gimplify.c:1716
0xae71cb gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:11619
0xaeb8d8 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:6478
0xaec9a8 gimplify_bind_expr
../../gcc/gcc/gimplify.c:1290
0xae7b7a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.c:11391
0xaeb8d8 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.c:6478
0xaed911 gimplify_body(tree_node*, bool)
../../gcc/gcc/gimplify.c:12388
Please submit a full bug report, [etc.]

[Bug c++/79687] [5/6/7 Regression] Wrong code with pointer-to-member

2017-02-24 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79687

--- Comment #19 from Volker Reichelt  ---
No, that's again invalid.
The second operand of .* or .-> must point to a valid class member,
otherwise you'll get undefined behavior.
The only way to achieve this in this class with a single member is to
initialize it with &A::c (or a copy of this value).

[Bug c++/79687] [5/6/7 Regression] Wrong code with pointer-to-member

2017-02-23 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79687

--- Comment #16 from Volker Reichelt  ---
According to [expr.mptr.oper] the code in comment 15 has undefined behavior,
because the second operand of ->* is the null-pointer-to-member-value.

[Bug c++/79687] [5/6/7 Regression] Wrong code with pointer-to-member

2017-02-23 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79687

--- Comment #11 from Volker Reichelt  ---
The following testcase returns 1 for me since at least GCC 4.7.
clang (3.2 - 4.0.0rc2), VS (2012, 2015) and ICC all return 0.


struct A
{
  char c;
};

int main()
{
  static char A::* p1 = &A::c;
  char A::* const q1 = p1;

  char A::* p2 = &A::c;
  static char A::* const q2 = p2;

  A a;
  return (&(a.*q1) - &a.c) || (&(a.*q2) - &a.c) ? 1 : 0;
}


[Bug c++/79687] [5/6/7 Regression] Wrong code with pointer-to-member

2017-02-23 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79687

--- Comment #5 from Volker Reichelt  ---
The problems actually seem to be older.

We experienced crashes already with GCC 4.8.2, but don't have a small testcase
for this, yet.

[Bug c++/79687] New: [6/7 Regression] Wrong code with pointer-to-member

2017-02-23 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79687

Bug ID: 79687
   Summary: [6/7 Regression] Wrong code with pointer-to-member
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following code snippet is miscompiled since GCC 6:

==
struct A
{
  char c;
};

int main()
{
  char A::* p = &A::c;
  static char A::* const q = p;

  A a;
  return &(a.*q) - &a.c;
}
==

The program should return 0, but doesn't.

[Bug c++/79681] New: ICE with constexpr and bitfield

2017-02-22 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79681

Bug ID: 79681
   Summary: ICE with constexpr and bitfield
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following valid code snippet triggers an ICE since GCC 5.1.0:


struct A
{
  int i : 4;
};

constexpr bool foo()
{
  A x[] = { 1 };
  return x[0].i;
}

bool b = foo();


bug.cc:12:13:   in constexpr expansion of 'foo()'
bug.cc:12:14: internal compiler error: tree check: expected field_decl, have
integer_cst in bit_position, at tree.c:3022
 bool b = foo();
  ^
0xffc41c tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc/gcc/tree.c:9813
0xffc5b8 tree_check(tree_node const*, char const*, int, char const*, tree_code)
../../gcc/gcc/tree.h:3320
0xffc5b8 bit_position(tree_node const*)
../../gcc/gcc/tree.c:3022
0x83a8c3 cxx_eval_bit_field_ref
../../gcc/gcc/cp/constexpr.c:2472
0x83a8c3 cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:4276
0x844b12 cxx_eval_binary_expression
../../gcc/gcc/cp/constexpr.c:1935
0x83a59a cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:4233
0x844b12 cxx_eval_binary_expression
../../gcc/gcc/cp/constexpr.c:1935
0x83a59a cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:4233
0x83e5ed cxx_eval_store_expression
../../gcc/gcc/cp/constexpr.c:3530
0x83a1b8 cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:4051
0x83c629 cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:4063
0x83ab94 cxx_eval_statement_list
../../gcc/gcc/cp/constexpr.c:3738
0x83ab94 cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:4434
0x83ad22 cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:4440
0x8390f2 cxx_eval_call_expression
../../gcc/gcc/cp/constexpr.c:1641
0x83ad43 cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:3973
0x840ace cxx_eval_outermost_constant_expr
../../gcc/gcc/cp/constexpr.c:4615
0x844194 maybe_constant_init(tree_node*, tree_node*)
../../gcc/gcc/cp/constexpr.c:4938
0x6b4c64 store_init_value(tree_node*, tree_node*, vec**, int)
../../gcc/gcc/cp/typeck2.c:819
Please submit a full bug report, [etc.]

[Bug c++/79672] New: ICE with -Wduplicated-branches -fopenmp

2017-02-22 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79672

Bug ID: 79672
   Summary: ICE with -Wduplicated-branches -fopenmp
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code, openmp
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The followiong code snippet triggers an ICE on trunk when
compiled with "-Wduplicated-branches -fopenmp":


template void foo()
{
  if (N > 0)
  {
#pragma omp parallel for
for (int i = 0; i < 10; ++i) ;
  }
}

void bar()
{
  foo<0>();
}


bug.cc: In instantiation of 'void foo() [with int N = 0]':
bug.cc:12:10:   required from here
bug.cc:8:1: internal compiler error: in add_expr, at tree.c:7925
 }
 ^
0xfe1677 inchash::add_expr(tree_node const*, inchash::hash&, unsigned int)
../../gcc/gcc/tree.c:7925
0xfe1af1 inchash::add_expr(tree_node const*, inchash::hash&, unsigned int)
../../gcc/gcc/tree.c:8010
0xfe1af1 inchash::add_expr(tree_node const*, inchash::hash&, unsigned int)
../../gcc/gcc/tree.c:8010
0xfe1af1 inchash::add_expr(tree_node const*, inchash::hash&, unsigned int)
../../gcc/gcc/tree.c:8010
0xfe1955 inchash::add_expr(tree_node const*, inchash::hash&, unsigned int)
../../gcc/gcc/tree.c:8010
0xfe1af1 inchash::add_expr(tree_node const*, inchash::hash&, unsigned int)
../../gcc/gcc/tree.c:8010
0x8a90a6 do_warn_duplicated_branches
../../gcc/gcc/c-family/c-warn.c:2263
0x8a90a6 do_warn_duplicated_branches_r(tree_node**, int*, void*)
../../gcc/gcc/c-family/c-warn.c:2290
0xff8a23 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*, tree_node*
(*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*,
hash_set >*))
../../gcc/gcc/tree.c:11796
0xff85a0 walk_tree_without_duplicates_1(tree_node**, tree_node*
(*)(tree_node**, int*, void*), void*, tree_node* (*)(tree_node**, int*,
tree_node* (*)(tree_node**, int*, void*), void*, hash_set >*))
../../gcc/gcc/tree.c:12139
0x86cb42 c_genericize(tree_node*)
../../gcc/gcc/c-family/c-gimplify.c:129
0x7f3b11 cp_genericize(tree_node*)
../../gcc/gcc/cp/cp-gimplify.c:1649
0x60ddb2 finish_function(int)
../../gcc/gcc/cp/decl.c:15703
0x67ac1b instantiate_decl(tree_node*, bool, bool)
../../gcc/gcc/cp/pt.c:22858
0x680f8b instantiate_pending_templates(int)
../../gcc/gcc/cp/pt.c:22955
0x6c4918 c_parse_final_cleanups()
../../gcc/gcc/cp/decl2.c:4526
Please submit a full bug report, [etc.]

[Bug c++/79664] New: ICE with #pragma omp parallel in constexpr function

2017-02-21 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79664

Bug ID: 79664
   Summary: ICE with #pragma omp parallel in constexpr function
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following code snippet (compiled with "-std=c++1y -fopenmp")
triggers an ICE since GCC 5.1.0:

==
constexpr int foo()
{
  int i = 0;
#pragma omp parallel for
  for ( i=0; i<10; ++i ) ;

  return 0;
}
==

bug.cc: In function 'constexpr int foo()':
bug.cc:8:1: sorry, unimplemented: unexpected AST of kind omp_parallel
 }
 ^
bug.cc:8:1: internal compiler error: in potential_constant_expression_1, at
cp/constexpr.c:4496
0x8531e4 potential_constant_expression_1
../../gcc-5.1.0/gcc/cp/constexpr.c:4496
0x852c8d potential_constant_expression_1
../../gcc-5.1.0/gcc/cp/constexpr.c:4102
0x853c00 potential_rvalue_constant_expression(tree_node*)
../../gcc-5.1.0/gcc/cp/constexpr.c:4521
0x853c00 register_constexpr_fundef(tree_node*, tree_node*)
../../gcc-5.1.0/gcc/cp/constexpr.c:782
0x67d445 maybe_save_function_definition
../../gcc-5.1.0/gcc/cp/decl.c:14095
0x67d445 finish_function(int)
../../gcc-5.1.0/gcc/cp/decl.c:14219
0x76c9c9 cp_parser_function_definition_after_declarator
../../gcc-5.1.0/gcc/cp/parser.c:23489
0x76d863 cp_parser_function_definition_from_specifiers_and_declarator
../../gcc-5.1.0/gcc/cp/parser.c:23395
0x76d863 cp_parser_init_declarator
../../gcc-5.1.0/gcc/cp/parser.c:17072
0x76f915 cp_parser_simple_declaration
../../gcc-5.1.0/gcc/cp/parser.c:11607
0x7693a3 cp_parser_block_declaration
../../gcc-5.1.0/gcc/cp/parser.c:11481
0x773249 cp_parser_declaration
../../gcc-5.1.0/gcc/cp/parser.c:11378
0x7718da cp_parser_declaration_seq_opt
../../gcc-5.1.0/gcc/cp/parser.c:11264
0x771bef cp_parser_translation_unit
../../gcc-5.1.0/gcc/cp/parser.c:4100
0x771bef c_parse_file()
../../gcc-5.1.0/gcc/cp/parser.c:33192
0x8a8ed2 c_common_parse_file()
../../gcc-5.1.0/gcc/c-family/c-opts.c:1057
Please submit a full bug report, [etc.]

[Bug c++/79641] New: [5/6/7 Regression] ICE with const variable and attribute

2017-02-20 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79641

Bug ID: 79641
   Summary: [5/6/7 Regression] ICE with const variable and
attribute
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---
 Build: [

The following valid line of code triggers an ICE since GCC 4.2.0:

==
const int __attribute__((mode (QI))) i = 0;
==

bug.cc:1:38: internal compiler error: in start_decl, at cp/decl.c:5150
 const int __attribute__((mode (QI))) i = 0;
  ^
0x63673f start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
../../gcc/gcc/cp/decl.c:5150
0x7195d7 cp_parser_init_declarator
../../gcc/gcc/cp/parser.c:19273
0x73dc1c cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:12795
0x73e9c5 cp_parser_block_declaration
../../gcc/gcc/cp/parser.c:12620
0x743d94 cp_parser_declaration
../../gcc/gcc/cp/parser.c:12518
0x7459bb cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:12394
0x745c9a cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4366
0x745c9a c_parse_file()
../../gcc/gcc/cp/parser.c:38430
0x8a4de3 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.c:1107
Please submit a full bug report, [etc.]

The C-frontend compiles the code without problem.

[Bug c++/79640] New: ICE with generic lambda expression

2017-02-20 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79640

Bug ID: 79640
   Summary: ICE with generic lambda expression
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following valid code snippet triggers an ICE since GCC 5.1.0:

===
template void foo(F f)
{
  f(1);
}

template void bar()
{
  const int i = i;
  foo([] (auto) { sizeof(i); });
}

void baz() { bar<1>(); }
===

g++: internal compiler error: Segmentation fault (program cc1plus)
Please submit a full bug report, [etc.]

[Bug c++/79639] New: [6/7 Regression] ICE with -O and constexpr

2017-02-20 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79639

Bug ID: 79639
   Summary: [6/7 Regression] ICE with -O and constexpr
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following valid testcase (compiled with "-std=c++1y -O")
triggers an ICE since GCC 6.1.0:


struct A
{
  void foo() {}
};

constexpr void bar(void (A::*f)())
{
  f = 0;
}

void baz()
{
  bar(&A::foo);
}


bug.cc: In function 'void baz()':
bug.cc:13:6:   in constexpr expansion of 'bar(&A::foo)'
bug.cc:14:1: internal compiler error: tree check: expected constructor, have
ptrmem_cst in cxx_eval_store_expression, at cp/constexpr.c:3540
 }
 ^
0xffc2ac tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc/gcc/tree.c:9813
0x83efbb tree_check(tree_node*, char const*, int, char const*, tree_code)
../../gcc/gcc/tree.h:3064
0x83efbb cxx_eval_store_expression
../../gcc/gcc/cp/constexpr.c:3540
0x83a118 cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:4049
0x83b8fa cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:4341
0x83a160 cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:4538
0x83a160 cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:4538
0x839052 cxx_eval_call_expression
../../gcc/gcc/cp/constexpr.c:1641
0x83aca3 cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:3971
0x840a2e cxx_eval_outermost_constant_expr
../../gcc/gcc/cp/constexpr.c:4613
0x843c26 maybe_constant_value(tree_node*, tree_node*)
../../gcc/gcc/cp/constexpr.c:4828
0x81d9cb cp_fold
../../gcc/gcc/cp/cp-gimplify.c:2336
0x81dfee cp_fold_r
../../gcc/gcc/cp/cp-gimplify.c:1014
0x1020f13 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*, tree_node*
(*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*,
hash_set >*))
../../gcc/gcc/tree.c:11796
0x821140 cp_fold_function(tree_node*)
../../gcc/gcc/cp/cp-gimplify.c:1085
0x639150 finish_function(int)
../../gcc/gcc/cp/decl.c:15598
0x7190fe cp_parser_function_definition_after_declarator
../../gcc/gcc/cp/parser.c:26276
0x719dcd cp_parser_function_definition_from_specifiers_and_declarator
../../gcc/gcc/cp/parser.c:26182
0x719dcd cp_parser_init_declarator
../../gcc/gcc/cp/parser.c:19177
0x73dc1c cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:12795
Please submit a full bug report, [etc.]

The testcase compiles fine with GCC 5.1.0

[Bug c++/79607] [5/6/7 Regression] ICE with brace-initialization of static const member

2017-02-19 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79607

--- Comment #1 from Volker Reichelt  ---
This might be related to PR79535.

[Bug c++/79607] New: [5/6/7 Regression] ICE with brace-initialization of static const member

2017-02-19 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79607

Bug ID: 79607
   Summary: [5/6/7 Regression] ICE with brace-initialization of
static const member
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code, rejects-valid
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following valid code snippet triggers an ICE since GCC 5.1.0:

=
template struct A
{
  static const int i = int{T{}};
};

A a;
=

bug.cc:3:31: internal compiler error: in verify_ctor_sanity, at
cp/constexpr.c:2633
   static const int i = int{T{}};
   ^
0x834b57 verify_ctor_sanity
../../gcc/gcc/cp/constexpr.c:2633
0x83a4ff cxx_eval_bare_aggregate
../../gcc/gcc/cp/constexpr.c:2669
0x83a4ff cxx_eval_constant_expression
../../gcc/gcc/cp/constexpr.c:4314
0x83fb1e cxx_eval_outermost_constant_expr
../../gcc/gcc/cp/constexpr.c:4613
0x6b4062 store_init_value(tree_node*, tree_node*, vec**, int)
../../gcc/gcc/cp/typeck2.c:817
0x61034b check_initializer
../../gcc/gcc/cp/decl.c:6362
0x63cac6 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
../../gcc/gcc/cp/decl.c:6930
0x6ec6fe grokfield(cp_declarator const*, cp_decl_specifier_seq*, tree_node*,
bool, tree_node*, tree_node*)
../../gcc/gcc/cp/decl2.c:961
0x719b03 cp_parser_member_declaration
../../gcc/gcc/cp/parser.c:23404
0x71a6ba cp_parser_member_specification_opt
../../gcc/gcc/cp/parser.c:22953
0x71a6ba cp_parser_class_specifier_1
../../gcc/gcc/cp/parser.c:22109
0x71cc19 cp_parser_class_specifier
../../gcc/gcc/cp/parser.c:22361
0x71cc19 cp_parser_type_specifier
../../gcc/gcc/cp/parser.c:16434
0x71db0a cp_parser_decl_specifier_seq
../../gcc/gcc/cp/parser.c:13347
0x719305 cp_parser_single_declaration
../../gcc/gcc/cp/parser.c:26628
0x73b25c cp_parser_template_declaration_after_parameters
../../gcc/gcc/cp/parser.c:26322
0x73aeec cp_parser_explicit_template_declaration
../../gcc/gcc/cp/parser.c:26557
0x73aeec cp_parser_template_declaration_after_export
../../gcc/gcc/cp/parser.c:26576
0x743009 cp_parser_declaration
../../gcc/gcc/cp/parser.c:12466
0x744b1b cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:12393
Please submit a full bug report, [etc.]

A similar code snippet is wrongly rejected:

=
template struct A
{
  static const int i = T{};
};

A a;
=

bug.cc:3:26: error: cannot convert 'T' to 'const int' in initialization
   static const int i = T{};
  ^

Both code snippets compile, if I replace 'T{}' by 'T()'.

[Bug c++/79606] New: [7 Regression] ICE with NSDMI and this pointer in template

2017-02-19 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79606

Bug ID: 79606
   Summary: [7 Regression] ICE with NSDMI and this pointer in
template
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following valid code snippet triggers an ICE on trunk:

=
struct A
{
  int i = 0;
};

template struct B : A
{
  int j = this->i;
};

B<0> b;
=

bug.cc:8:17: internal compiler error: in build_simple_base_path, at
cp/class.c:597
   int j = this->i;
 ^
0x6b87f3 build_simple_base_path
../../gcc/gcc/cp/class.c:597
0x6d7c8f build_base_path(tree_code, tree_node*, tree_node*, int, int)
../../gcc/gcc/cp/class.c:430
0x763f22 build_class_member_access_expr(cp_expr, tree_node*, tree_node*, bool,
int)
../../gcc/gcc/cp/typeck.c:2413
0x764b35 finish_class_member_access_expr(cp_expr, tree_node*, bool, int)
../../gcc/gcc/cp/typeck.c:2898
0x72e620 cp_parser_postfix_dot_deref_expression
../../gcc/gcc/cp/parser.c:7467
0x721abd cp_parser_postfix_expression
../../gcc/gcc/cp/parser.c:7044
0x722ebd cp_parser_unary_expression
../../gcc/gcc/cp/parser.c:8124
0x723e13 cp_parser_cast_expression
../../gcc/gcc/cp/parser.c:8801
0x724567 cp_parser_binary_expression
../../gcc/gcc/cp/parser.c:8902
0x724e34 cp_parser_assignment_expression
../../gcc/gcc/cp/parser.c:9189
0x725237 cp_parser_constant_expression
../../gcc/gcc/cp/parser.c:9459
0x726154 cp_parser_initializer_clause
../../gcc/gcc/cp/parser.c:21586
0x72739b cp_parser_initializer
../../gcc/gcc/cp/parser.c:21526
0x7274a1 cp_parser_late_parse_one_default_arg
../../gcc/gcc/cp/parser.c:27205
0x71ac35 cp_parser_late_parsing_nsdmi
../../gcc/gcc/cp/parser.c:27253
0x71ac35 cp_parser_class_specifier_1
../../gcc/gcc/cp/parser.c:22308
0x71cc19 cp_parser_class_specifier
../../gcc/gcc/cp/parser.c:22361
0x71cc19 cp_parser_type_specifier
../../gcc/gcc/cp/parser.c:16434
0x71db0a cp_parser_decl_specifier_seq
../../gcc/gcc/cp/parser.c:13347
0x719305 cp_parser_single_declaration
../../gcc/gcc/cp/parser.c:26628
Please submit a full bug report, [etc.]

[Bug c++/79555] Warning 'base class should be explicitly initialized in the copy constructor' issued in wrong case

2017-02-16 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79555

Volker Reichelt  changed:

   What|Removed |Added

  Known to work|6.3.1   |
Summary|[7 Regression] Warning  |Warning 'base class should
   |'base class should be   |be explicitly initialized
   |explicitly initialized in   |in the copy constructor'
   |the copy constructor'   |issued in wrong case
   |issued in wrong case|
  Known to fail||3.3, 3.4.0, 4.0.0, 4.9.0,
   ||5.1.0, 6.1.0, 7.0

--- Comment #2 from Volker Reichelt  ---
Well, I can reproduce the warning with every version since GCC 3.3, so it's
definitely not a regression.
(Before GCC 3.4.0 you have to use -W instead of -Wextra).

[Bug c++/79555] New: Warning 'base class should be explicitly initialized in the copy constructor' issued in wrong case

2017-02-16 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79555

Bug ID: 79555
   Summary: Warning 'base class should be explicitly initialized
in the copy constructor' issued in wrong case
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: diagnostic
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The C++ front-end (with -Wextra enabled) complains about the following code
snippet:


struct A
{
  A();
  A(const A&);
};

struct B : virtual A
{
  B(const B&) {}
//  B(const B&) : A() {}
  virtual int foo() = 0;
};


bug.cc: In copy constructor 'B::B(const B&)':
bug.cc:9:3: warning: base class 'struct A' should be explicitly initialized in
the copy constructor [-Wextra]
   B(const B&) {}
   ^

However, since the base class A is virtual and the class B itself is abstract,
A isn't initialized in this function anyway (and so the warning is pointless).
Even more annoying is the fact that other major compilers complain if you try
to
please GCC and initialize A (as in the comment line above):

* clang with (clang++ -Wabstract-vbase-init -c):
bug.cc:10:17: warning: initializer for virtual base class 'A' of abstract
 class 'B' will never be used [-Wabstract-vbase-init]

* VisualStudio 2015 (cl -Wall)
bug.cc(10): warning C4589: Constructor of abstract class 'B' ignores
initializer for virtual base class 'A'
bug.cc(10): note: virtual base classes are only initialized by the most-derived
type

So it would be nice to suppress the warning in this specific case.

[Bug c++/79525] New: [c++1y] ICE with auto as function parameter

2017-02-15 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79525

Bug ID: 79525
   Summary: [c++1y] ICE with auto as function parameter
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following invalid code snippet triggers an ICE since the introduction
of auto as function parameter (GCC 4.9.0):

===
template struct A {};

struct B : A
{
  B();
};
===

bug.cc:5:5: internal compiler error: in poplevel, at cp/decl.c:568
   B();
 ^
0x567483 poplevel(int, int, int)
../../gcc/gcc/cp/decl.c:568
0x5a1138 end_template_decl()
../../gcc/gcc/cp/pt.c:3795
0x6464d1 finish_fully_implicit_template
../../gcc/gcc/cp/parser.c:32147
0x64f7e1 cp_parser_member_declaration
../../gcc/gcc/cp/parser.c:20550
0x65248c cp_parser_member_specification_opt
../../gcc/gcc/cp/parser.c:20093
0x65248c cp_parser_class_specifier_1
../../gcc/gcc/cp/parser.c:19321
0x654d40 cp_parser_class_specifier
../../gcc/gcc/cp/parser.c:19548
0x654d40 cp_parser_type_specifier
../../gcc/gcc/cp/parser.c:14337
0x66d200 cp_parser_decl_specifier_seq
../../gcc/gcc/cp/parser.c:11573
0x672da9 cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:11163
0x656f13 cp_parser_block_declaration
../../gcc/gcc/cp/parser.c:2
0x67d542 cp_parser_declaration
../../gcc/gcc/cp/parser.c:11009
0x67c238 cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:10895
0x67daea cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4030
0x67daea c_parse_file()
../../gcc/gcc/cp/parser.c:31660
0x79e293 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.c:1061
Please submit a full bug report, [etc.]

[Bug c++/79519] New: [5/6/7 Regression] ICE deleting template friend function

2017-02-14 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79519

Bug ID: 79519
   Summary: [5/6/7 Regression] ICE deleting template friend
function
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following invalid code snippet triggers since GCC 5.1.0:

==
struct A
{
  template void foo();
};

struct B
{
  template friend void A::foo() = delete;
};
==

bug.cc:8:45: internal compiler error: in grokfield, at cp/decl2.c:930
   template friend void A::foo() = delete;
 ^~
0x6ec8b1 grokfield(cp_declarator const*, cp_decl_specifier_seq*, tree_node*,
bool, tree_node*, tree_node*)
../../gcc/gcc/cp/decl2.c:930
0x7390a3 cp_parser_init_declarator
../../gcc/gcc/cp/parser.c:19375
0x71321a cp_parser_single_declaration
../../gcc/gcc/cp/parser.c:26728
0x73361c cp_parser_template_declaration_after_parameters
../../gcc/gcc/cp/parser.c:26332
0x7332ac cp_parser_explicit_template_declaration
../../gcc/gcc/cp/parser.c:26567
0x7332ac cp_parser_template_declaration_after_export
../../gcc/gcc/cp/parser.c:26586
0x70e571 cp_parser_member_declaration
../../gcc/gcc/cp/parser.c:23024
0x70f3fa cp_parser_member_specification_opt
../../gcc/gcc/cp/parser.c:22951
0x70f3fa cp_parser_class_specifier_1
../../gcc/gcc/cp/parser.c:22107
0x711a29 cp_parser_class_specifier
../../gcc/gcc/cp/parser.c:22359
0x711a29 cp_parser_type_specifier
../../gcc/gcc/cp/parser.c:16432
0x71291a cp_parser_decl_specifier_seq
../../gcc/gcc/cp/parser.c:13345
0x739b01 cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:12670
0x73aa25 cp_parser_block_declaration
../../gcc/gcc/cp/parser.c:12617
0x7135d4 cp_parser_declaration
../../gcc/gcc/cp/parser.c:12515
0x74406b cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:12391
0x74434a cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4366
0x74434a c_parse_file()
../../gcc/gcc/cp/parser.c:38425
0x8a2f73 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.c:1107
Please submit a full bug report, [etc.]

[Bug c++/79379] New: [7 Regression] ICE with #pragma GCC ivdep

2017-02-04 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79379

Bug ID: 79379
   Summary: [7 Regression] ICE with #pragma GCC ivdep
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following valid code snippet triggers an ICE on trunk:

==
template void foo(int* p)
{
#pragma GCC ivdep
  for (int i = 0; p[i]; ++i) ;
}

void bar(int* p)
{
  foo<0>(p);
}
==

bug.cc: In instantiation of 'void foo(int*) [with int  = 0]':
bug.cc:9:11:   required from here
bug.cc:4:17: sorry, unimplemented: unexpected AST of kind annotate_expr
   for (int i = 0; p[i]; ++i) ;
 ^
bug.cc:4:17: internal compiler error: in potential_constant_expression_1, at
cp/constexpr.c:5697
0x83f32a potential_constant_expression_1
../../gcc/gcc/cp/constexpr.c:5697
0x83fcd9 potential_constant_expression(tree_node*)
../../gcc/gcc/cp/constexpr.c:5708
0x83fcd9 potential_nondependent_constant_expression(tree_node*)
../../gcc/gcc/cp/constexpr.c:5750
0x840d64 maybe_constant_value(tree_node*, tree_node*)
../../gcc/gcc/cp/constexpr.c:4787
0x81be2a cp_fully_fold(tree_node*)
../../gcc/gcc/cp/cp-gimplify.c:1963
0x75c644 cp_build_binary_op(unsigned int, tree_code, tree_node*, tree_node*,
int)
../../gcc/gcc/cp/typeck.c:5237
0x76de98 ocp_convert(tree_node*, tree_node*, int, int, int)
../../gcc/gcc/cp/cvt.c:801
0x76fbcb cp_convert(tree_node*, tree_node*, int)
../../gcc/gcc/cp/cvt.c:616
0x76fbcb cp_convert_and_check(tree_node*, tree_node*, int)
../../gcc/gcc/cp/cvt.c:635
0x5f7445 convert_like_real
../../gcc/gcc/cp/call.c:7042
0x5f835c perform_implicit_conversion_flags(tree_node*, tree_node*, int, int)
../../gcc/gcc/cp/call.c:10071
0x74dc04 condition_conversion(tree_node*)
../../gcc/gcc/cp/typeck.c:5547
0x7ac4e7 maybe_convert_cond
../../gcc/gcc/cp/semantics.c:989
0x7ac4e7 finish_for_cond(tree_node*, tree_node*, bool)
../../gcc/gcc/cp/semantics.c:980
0x66ecdb tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/gcc/cp/pt.c:15790
0x66f2b0 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/gcc/cp/pt.c:15880
0x66ba67 instantiate_decl(tree_node*, bool, bool)
../../gcc/gcc/cp/pt.c:22817
0x6abadb instantiate_pending_templates(int)
../../gcc/gcc/cp/pt.c:22938
0x6ee668 c_parse_final_cleanups()
../../gcc/gcc/cp/decl2.c:4525
Please submit a full bug report, [etc.]

[Bug c++/78345] [5/6/7 Regression] ICE on invalid c++ code on x86_64-linux-gnu (internal compiler error: in cxx_eval_outermost_constant_expr, at cp/constexpr.c:4464)

2017-02-04 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78345

Volker Reichelt  changed:

   What|Removed |Added

   Keywords|error-recovery  |
   Priority|P4  |P3
 CC||reichelt at gcc dot gnu.org
  Known to work|4.9.4   |4.8.4
  Known to fail||4.9.4

--- Comment #4 from Volker Reichelt  ---
Here's a slightly modified testcase that triggers the ICE without a proper
error message before:

===
struct
{
  const int i;
} a[1] = []{};
===

bug.cc:4:13: internal compiler error: in cxx_eval_outermost_constant_expr, at
cp/constexpr.c:4581
 } a[1] = []{};
 ^
0x83e276 cxx_eval_outermost_constant_expr
../../gcc/gcc/cp/constexpr.c:4580
0x841314 maybe_constant_init(tree_node*, tree_node*)
../../gcc/gcc/cp/constexpr.c:4913
0x6b3794 store_init_value(tree_node*, tree_node*, vec**, int)
../../gcc/gcc/cp/typeck2.c:819
0x61049b check_initializer
../../gcc/gcc/cp/decl.c:6359
0x63a8bc cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
../../gcc/gcc/cp/decl.c:7024
0x738acc cp_parser_init_declarator
../../gcc/gcc/cp/parser.c:19374
0x73931c cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:12768
0x73a0d5 cp_parser_block_declaration
../../gcc/gcc/cp/parser.c:12593
0x712d34 cp_parser_declaration
../../gcc/gcc/cp/parser.c:12491
0x74353b cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:12367
0x74381a cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4366
0x74381a c_parse_file()
../../gcc/gcc/cp/parser.c:38382
0x8a1fa3 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.c:1107
Please submit a full bug report, [etc.]

So I'm removing the error-recovery tag and reset the importance to P3.
Also GCC 4.9.x wrongfully accepts this code snippet,
whereas GCC 4.8.x and before correctly reject the code.

[Bug c++/79377] New: [6/7 Regression] ICE with increment operator in -fpermissive mode

2017-02-04 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79377

Bug ID: 79377
   Summary: [6/7 Regression] ICE with increment operator in
-fpermissive mode
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following code snippet (compiled with "-fpermissive") triggers an ICE since
GCC 6.1.0:

=
struct A
{
  A& operator++();
};

template void foo(A& a)
{
  a++;
}
=

bug.cc: In function 'void foo(A&)':
bug.cc:8:4: warning: no 'operator++(int)' declared for postfix '++', trying
prefix operator instead [-fpermissive]
   a++;
   ~^~
bug.cc:8:4: internal compiler error: in build_min_non_dep_op_overload, at
cp/tree.c:2944
   a++;
^~
0x7d192a build_min_non_dep_op_overload(tree_code, tree_node*, tree_node*, ...)
../../gcc/gcc/cp/tree.c:2944
0x758c81 build_x_unary_op(unsigned int, tree_code, cp_expr, int)
../../gcc/gcc/cp/typeck.c:5490
0x79f980 finish_increment_expr(cp_expr, tree_code)
../../gcc/gcc/cp/semantics.c:2514
0x720389 cp_parser_postfix_expression
../../gcc/gcc/cp/parser.c:7057
0x72166d cp_parser_unary_expression
../../gcc/gcc/cp/parser.c:8098
0x7225c3 cp_parser_cast_expression
../../gcc/gcc/cp/parser.c:8775
0x722d17 cp_parser_binary_expression
../../gcc/gcc/cp/parser.c:8876
0x7235e4 cp_parser_assignment_expression
../../gcc/gcc/cp/parser.c:9163
0x727318 cp_parser_expression
../../gcc/gcc/cp/parser.c:9332
0x72c908 cp_parser_expression_statement
../../gcc/gcc/cp/parser.c:10880
0x7152cc cp_parser_statement
../../gcc/gcc/cp/parser.c:10696
0x7169cd cp_parser_statement_seq_opt
../../gcc/gcc/cp/parser.c:11022
0x716a9f cp_parser_compound_statement
../../gcc/gcc/cp/parser.c:10976
0x72abe3 cp_parser_function_body
../../gcc/gcc/cp/parser.c:21426
0x72abe3 cp_parser_ctor_initializer_opt_and_function_body
../../gcc/gcc/cp/parser.c:21464
0x733641 cp_parser_function_definition_after_declarator
../../gcc/gcc/cp/parser.c:26231
0x738e40 cp_parser_function_definition_from_specifiers_and_declarator
../../gcc/gcc/cp/parser.c:26143
0x738e40 cp_parser_init_declarator
../../gcc/gcc/cp/parser.c:19153
0x71297a cp_parser_single_declaration
../../gcc/gcc/cp/parser.c:26689
0x732c7c cp_parser_template_declaration_after_parameters
../../gcc/gcc/cp/parser.c:26293
Please submit a full bug report, [etc.]

Although the correct operator is missing, the code is deemed valid
in the "-fpermissive" mode, so I'm filing this under ice-on-valid-code.

[Bug c++/79368] [7 Regression] ICE with pointer to unnamed struct

2017-02-04 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79368

Volker Reichelt  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #3 from Volker Reichelt  ---
It's indeed fixed with today's version.
It was most probably fixed by r244575:

2017-01-18  Nathan Sidwell  

PR c++/79091
* mangle.c (write_exception_spec): Check nothrow explicitly.
(write_encoding): Don't increment processing_template_decl around
encoding.

So closing this bug as duplicate of PR79091.
Sorry for the noise.

*** This bug has been marked as a duplicate of bug 79091 ***

[Bug c++/79091] [7 regression] ICE in write_unnamed_type

2017-02-04 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79091

Volker Reichelt  changed:

   What|Removed |Added

 CC||reichelt at gcc dot gnu.org

--- Comment #8 from Volker Reichelt  ---
*** Bug 79368 has been marked as a duplicate of this bug. ***

[Bug c++/79368] [7 Regression] ICE with pointer to unnamed struct

2017-02-04 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79368

--- Comment #2 from Volker Reichelt  ---
I was using r244478 from 2017-01-15.
I'll retry with today's version.

The command line was just plain "g++ -c".

[Bug c++/79368] New: [7 Regression] ICE with pointer to unnamed struct

2017-02-03 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79368

Bug ID: 79368
   Summary: [7 Regression]  ICE with pointer to unnamed struct
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following valid code snippet triggers an ICE on trunk:

===
typedef struct{}* X;

template void foo(X, T) {}

void bar()
{
  foo(0, 0);
}
===

bug.cc: In instantiation of 'void foo(X, T) [with T = int]':
bug.cc:3:27:   required from here
bug.cc:3:27: internal compiler error: in write_unnamed_type_name, at
cp/mangle.c:1623
 template void foo(X, T) {}
   ^~~
0x825126 write_unnamed_type_name
../../gcc/gcc/cp/mangle.c:1623
0x825126 write_unqualified_name
../../gcc/gcc/cp/mangle.c:1382
0x825bbf write_name
../../gcc/gcc/cp/mangle.c:939
0x826f7f write_class_enum_type
../../gcc/gcc/cp/mangle.c:2769
0x826f7f write_type
../../gcc/gcc/cp/mangle.c:2187
0x826186 write_type
../../gcc/gcc/cp/mangle.c:2267
0x828a24 write_method_parms
../../gcc/gcc/cp/mangle.c:2756
0x828c96 write_bare_function_type
../../gcc/gcc/cp/mangle.c:2698
0x828e12 write_encoding
../../gcc/gcc/cp/mangle.c:848
0x8303ac mangle_decl_string
../../gcc/gcc/cp/mangle.c:3743
0x830762 get_mangled_id
../../gcc/gcc/cp/mangle.c:3765
0x830762 mangle_decl(tree_node*)
../../gcc/gcc/cp/mangle.c:3835
0x103021e decl_assembler_name(tree_node*)
../../gcc/gcc/tree.c:671
0x1055fbd assign_assembler_name_if_neeeded(tree_node*)
../../gcc/gcc/tree.c:5920
0x997d8b cgraph_node::analyze()
../../gcc/gcc/cgraphunit.c:619
0x99afb9 analyze_functions
../../gcc/gcc/cgraphunit.c:1087
0x99c012 symbol_table::finalize_compilation_unit()
../../gcc/gcc/cgraphunit.c:2562
Please submit a full bug report, [etc.]

[Bug c++/79363] New: [6/7 Regression] ICE with NSDMI and array

2017-02-03 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79363

Bug ID: 79363
   Summary: [6/7 Regression] ICE with NSDMI and array
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following valid code snippet triggers an ICE since GCC 6.1.0:

==
struct A {};

struct B
{
  B() {}
  int i;
  A a[]{};
};
==

bug.cc: In constructor 'B::B()':
bug.cc:5:7: internal compiler error: tree check: expected tree that contains
'common' structure, have 'constructor' in perform_member_init, at cp/init.c:725
   B() {}
   ^
0x10301f4 tree_contains_struct_check_failed(tree_node const*,
tree_node_structure_enum, char const*, int, char const*)
../../gcc/gcc/tree.c:9986
0x7c3da2 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
../../gcc/gcc/tree.h:3174
0x7c3da2 perform_member_init
../../gcc/gcc/cp/init.c:725
0x7c3da2 emit_mem_initializers(tree_node*)
../../gcc/gcc/cp/init.c:1203
0x76a3d6 cp_parser_ctor_initializer_opt
../../gcc/gcc/cp/parser.c:14016
0x76a3d6 cp_parser_ctor_initializer_opt_and_function_body
../../gcc/gcc/cp/parser.c:21423
0x772dc1 cp_parser_function_definition_after_declarator
../../gcc/gcc/cp/parser.c:26206
0x77319c cp_parser_late_parsing_for_member
../../gcc/gcc/cp/parser.c:27088
0x74f9c9 cp_parser_class_specifier_1
../../gcc/gcc/cp/parser.c:22292
0x750a59 cp_parser_class_specifier
../../gcc/gcc/cp/parser.c:22318
0x750a59 cp_parser_type_specifier
../../gcc/gcc/cp/parser.c:16409
0x751827 cp_parser_decl_specifier_seq
../../gcc/gcc/cp/parser.c:13326
0x778901 cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:12647
0x779845 cp_parser_block_declaration
../../gcc/gcc/cp/parser.c:12592
0x752527 cp_parser_declaration
../../gcc/gcc/cp/parser.c:12489
0x782c8b cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:12365
0x782f6a cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4369
0x782f6a c_parse_file()
../../gcc/gcc/cp/parser.c:38356
0x8df643 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.c:1107
Please submit a full bug report, [etc.]

[Bug c++/79361] New: [5/6/7 Regression] ICE redefining a template function as defaulted or deleted

2017-02-03 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79361

Bug ID: 79361
   Summary: [5/6/7 Regression] ICE redefining a template function
as defaulted or deleted
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following two invalid testcases trigger ICEs on trunk:

===
template void foo(T);

template<> void foo(int) {}
template<> void foo(int) = delete;
===

bug.cc:4:17: error: redefinition of 'void foo(T) [with T = int]'
 template<> void foo(int) = delete;
 ^~~~
bug.cc:3:17: note: 'void foo(T) [with T = int]' previously declared here
 template<> void foo(int) {}
 ^~~~
bug.cc: In function 'void foo(T) [with T = int]':
bug.cc:3:17: internal compiler error: tree check: expected block, have
error_mark in lower_function_body, at gimple-low.c:98
0x102f4bc tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc/gcc/tree.c:9814
0x14904c7 tree_check(tree_node*, char const*, int, char const*, tree_code)
../../gcc/gcc/tree.h:3060
0x14904c7 lower_function_body
../../gcc/gcc/gimple-low.c:98
0x14904c7 execute
../../gcc/gcc/gimple-low.c:181
Please submit a full bug report, [etc.]


===
template void foo(T);

template<> void foo(int) {}
template<> void foo(int) = default;
===

bug.cc:4:17: error: redefinition of 'void foo(T) [with T = int]'
 template<> void foo(int) = default;
 ^~~~
bug.cc:3:17: note: 'void foo(T) [with T = int]' previously declared here
 template<> void foo(int) {}
 ^~~~
bug.cc:4:33: error: a template cannot be defaulted
 template<> void foo(int) = default;
 ^~~
bug.cc: In function 'void foo(T) [with T = int]':
bug.cc:3:17: internal compiler error: Segmentation fault
 template<> void foo(int) {}
 ^~~~
0xd9292f crash_signal
../../gcc/gcc/toplev.c:333
0x14901ae tree_check(tree_node*, char const*, int, char const*, tree_code)
../../gcc/gcc/tree.h:3059
0x14901ae lower_function_body
../../gcc/gcc/gimple-low.c:98
0x14901ae execute
../../gcc/gcc/gimple-low.c:181
Please submit a full bug report, [etc.]


These bugs appeared in GCC 4.5.0.

[Bug c++/79360] New: [5.4/6/7 Regression] ICE with NSDMI and enum in union

2017-02-03 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79360

Bug ID: 79360
   Summary: [5.4/6/7 Regression] ICE with NSDMI and enum in union
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

Compiling the following valid code results in a crash

===
union U
{
  enum E { e };
};

struct A
{
  U u{};
};
===

bug3.cc:8:7: internal compiler error: in process_init_constructor_union, at
cp/typeck2.c:1562
   U u{};
   ^
0x6f222d process_init_constructor_union
../../gcc/gcc/cp/typeck2.c:1561
0x6f222d process_init_constructor
../../gcc/gcc/cp/typeck2.c:1616
0x6f222d digest_init_r
../../gcc/gcc/cp/typeck2.c:1125
0x6f4230 digest_init_flags(tree_node*, tree_node*, int, int)
../../gcc/gcc/cp/typeck2.c:1170
0x6f4230 digest_nsdmi_init(tree_node*, tree_node*)
../../gcc/gcc/cp/typeck2.c:1186
0x76539f cp_parser_late_parse_one_default_arg
../../gcc/gcc/cp/parser.c:27167
0x74f693 cp_parser_late_parsing_nsdmi
../../gcc/gcc/cp/parser.c:27200
0x74f693 cp_parser_class_specifier_1
../../gcc/gcc/cp/parser.c:22265
0x750a59 cp_parser_class_specifier
../../gcc/gcc/cp/parser.c:22318
0x750a59 cp_parser_type_specifier
../../gcc/gcc/cp/parser.c:16409
0x751827 cp_parser_decl_specifier_seq
../../gcc/gcc/cp/parser.c:13326
0x778901 cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:12647
0x779845 cp_parser_block_declaration
../../gcc/gcc/cp/parser.c:12592
0x752527 cp_parser_declaration
../../gcc/gcc/cp/parser.c:12489
0x782c8b cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:12365
0x782f6a cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4369
0x782f6a c_parse_file()
../../gcc/gcc/cp/parser.c:38356
0x8df643 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.c:1107
Please submit a full bug report, [etc.]

This bug appears in GCC 5.4.0, 6.x, 7.0, but not in GCC 5.3.0 or before.

[Bug sanitizer/70147] [6 Regression] testcase from hana testsuite gets miscompiled with -fsanitize=undefined

2016-03-14 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70147

Volker Reichelt  changed:

   What|Removed |Added

 CC||reichelt at gcc dot gnu.org
  Known to work||5.3.0
Summary|testcase from hana  |[6 Regression] testcase
   |testsuite gets miscompiled  |from hana testsuite gets
   |with -fsanitize=undefined   |miscompiled with
   ||-fsanitize=undefined
  Known to fail||6.0

--- Comment #8 from Volker Reichelt  ---
This is a regression that was introduced between the 20160228 snapshot and the
20160306 snapshot.

[Bug c++/70029] [6 Regression] ICE with C++11 and -flto

2016-03-01 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70029

Volker Reichelt  changed:

   What|Removed |Added

  Known to work||5.3.0
   Target Milestone|--- |6.0
  Known to fail||6.0

[Bug c++/70029] New: [6 Regression] ICE with C++11 and -flto

2016-03-01 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70029

Bug ID: 70029
   Summary: [6 Regression] ICE with C++11 and -flto
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code, lto
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following valid code snippet triggers an ICE on trunk when compiled with
"-std=c++11 -g -flto":


struct A
{
  A();
  int foo() && __attribute__ ((__warn_unused_result__)) { return 0; }
};

A a;


bug.cc:7:4: error: TYPE_CANONICAL of main variant is not main variant
 A a;
^
 
unit size 
align 32 symtab 692482528 alias set 2 canonical type 0x7fac294417e0
precision 32 min  max 
pointer_to_this >
tree_4 tree_5 QI
size  constant 8>
unit size  constant 1>
align 8 symtab 0 alias set -1 canonical type 0x7fac2957f888 method basetype

arg-types 
asm_written unsigned DI
size 
unit size 
align 64 symtab 692482368 alias set -1 canonical type
0x7fac2957f5e8>
chain >>>
 
unit size 
align 32 symtab 692482528 alias set 2 canonical type 0x7fac294417e0
precision 32 min  max 
pointer_to_this >
QI
size  constant 8>
unit size  constant 1>
align 8 symtab 0 alias set -1 canonical type 0x7fac2957f7e0 method basetype

arg-types 
asm_written unsigned DI
size 
unit size 
align 64 symtab 692482368 alias set -1 canonical type
0x7fac2957f5e8>
chain >>>
 
unit size 
align 32 symtab 692482528 alias set 2 canonical type 0x7fac294417e0
precision 32 min  max 
pointer_to_this >
QI
size  constant 8>
unit size  constant 1>
align 8 symtab 0 alias set -1 canonical type 0x7fac2957f888
attributes 
local bindings <(nil)>>> method basetype 
arg-types 
asm_written unsigned DI
size 
unit size 
align 64 symtab 692482368 alias set -1 canonical type
0x7fac2957f5e8>
chain >>>
bug.cc:7:4: internal compiler error: verify_type failed
0xfa84c2 verify_type(tree_node const*)
../../gcc/gcc/tree.c:13900
0xfaa34b free_lang_data_in_cgraph
../../gcc/gcc/tree.c:5984
0xfaa34b free_lang_data
../../gcc/gcc/tree.c:6014
0xfaa34b execute
../../gcc/gcc/tree.c:6063
Please submit a full bug report, [etc.]


This is a regression w.r.t GCC 5.3.0.
The bug makes it impossible to compile Qt (Qt 5.4.2) programs with -flto,
because QString contains such a pattern.

[Bug c++/68586] [6 Regression] Enum template parameter wrongly rejected

2015-11-30 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68586

Volker Reichelt  changed:

   What|Removed |Added

 CC||jason at redhat dot com
  Known to work||5.2.0

--- Comment #3 from Volker Reichelt  ---
You're right Martin, The bug indeed appeared with r230365.

[Bug bootstrap/68540] 6.0 build process broken on Linux Mint, potential include ordering problem

2015-11-27 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68540

Volker Reichelt  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-11-27
 CC||reichelt at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #3 from Volker Reichelt  ---
I have the same problem on an OpenSUSE 13.1 distribution.

[Bug c++/68586] New: [6 Regression] Enum template parameter wrongly rejected

2015-11-27 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68586

Bug ID: 68586
   Summary: [6 Regression] Enum template parameter wrongly
rejected
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Keywords: rejects-valid
  Severity: major
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following valid code snippet is wrongly rejected on trunk (6.0.0 20151122):


enum E { x = 1, y = x << 1 };

template struct A {};

A a;


bug.cc:5:4: error: invalid conversion from 'int' to 'E' [-fpermissive]
 A a;
^

During reduction from a larger testcase I had to tweak the settings
of the garbage collector (--param ggc-min-expand=0) to make it appear reliably.

[Bug c++/65970] New: [C++14] Endless loop with constexpr

2015-05-01 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65970

Bug ID: 65970
   Summary: [C++14] Endless loop with constexpr
   Product: gcc
   Version: 5.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The compiler loops forever when compiling the following invalid testcase with
-std=c++14:


constexpr int foo()
{
  while (true) x;
  return 0;
}

int i = foo();


At least it gives an error before it hangs:

bug.cc: In function 'constexpr int foo()':
bug.cc:3:16: error: 'x' was not declared in this scope
   while (true) x;


[Bug c++/58597] [c++11] ICE with lambda in default argument of template function

2015-01-14 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58597

--- Comment #4 from Volker Reichelt  ---
The ICE disappered on the 4.9 branch in GCC 4.9.2.
But the testcase still crashes trunk with a different stack trace:


bug.cc:6:12: internal compiler error: Segmentation fault
 A a = 0;
^
0xcdc42f crash_signal
../../gcc/gcc/toplev.c:372
0x6943ae tsubst_default_argument(tree_node*, tree_node*, tree_node*, int)
../../gcc/gcc/cp/pt.c:10496
0x629f9f convert_default_arg(tree_node*, tree_node*, tree_node*, int, int)
../../gcc/gcc/cp/call.c:6774
0x62a91d build_over_call
../../gcc/gcc/cp/call.c:7301
0x62f9b4 convert_like_real
../../gcc/gcc/cp/call.c:6253
0x62f799 convert_like_real
../../gcc/gcc/cp/call.c:6384
0x6395d7 build_user_type_conversion(tree_node*, tree_node*, int, int)
../../gcc/gcc/cp/call.c:3831
0x78897e ocp_convert(tree_node*, tree_node*, int, int, int)
../../gcc/gcc/cp/cvt.c:875
0x7969f5 expand_default_init
../../gcc/gcc/cp/init.c:1661
0x7969f5 expand_aggr_init_1
../../gcc/gcc/cp/init.c:1830
0x7971e4 build_aggr_init(tree_node*, tree_node*, int, int)
../../gcc/gcc/cp/init.c:1582
0x66cddc build_aggr_init_full_exprs
../../gcc/gcc/cp/decl.c:5780
0x66cddc check_initializer
../../gcc/gcc/cp/decl.c:5924
0x66e79c cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
../../gcc/gcc/cp/decl.c:6607
0x756539 cp_parser_init_declarator
../../gcc/gcc/cp/parser.c:17290
0x758185 cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:11600
0x7585b3 cp_parser_block_declaration
../../gcc/gcc/cp/parser.c:11474
0x760689 cp_parser_declaration
../../gcc/gcc/cp/parser.c:11371
0x76098a cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:11257
0x760cc7 cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4108
Please submit a full bug report, [etc.]


[Bug libstdc++/64571] [5.0 Regression] Link failure with fstream due to new string implementation

2015-01-12 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64571

Volker Reichelt  changed:

   What|Removed |Added

  Known to work||4.8.0, 4.9.0, 4.9.2
   Target Milestone|--- |5.0
  Known to fail||5.0


<    1   2   3   4   5   6   7   8   >