[Bug c++/110106] [11/12/13/14 Regression] ICE on noexcept(noexcept(...)) with optional

2023-07-21 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110106

--- Comment #5 from CVS Commits  ---
The trunk branch has been updated by Marek Polacek :

https://gcc.gnu.org/g:e36d1994051122fc6e1f8c728fbd109a59e0a822

commit r14-2717-ge36d1994051122fc6e1f8c728fbd109a59e0a822
Author: Marek Polacek 
Date:   Tue Jul 18 16:02:21 2023 -0400

c++: fix ICE with is_really_empty_class [PR110106]

is_really_empty_class is liable to crash when it gets an incomplete
or dependent type.  Since r11-557, we pass the yet-uninstantiated
class type S<0> of the PARM_DECL s to is_really_empty_class -- because
of the potential_rvalue_constant_expression ->
is_rvalue_constant_expression
change in cp_parser_constant_expression.  Here we're not parsing
a template so we did not check COMPLETE_TYPE_P as we should.

It should work to complete the type before checking COMPLETE_TYPE_P.

PR c++/110106

gcc/cp/ChangeLog:

* constexpr.cc (potential_constant_expression_1): Try to complete
the
type when !processing_template_decl.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/noexcept80.C: New test.

[Bug c++/110106] [11/12/13/14 Regression] ICE on noexcept(noexcept(...)) with optional

2023-07-18 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110106

Marek Polacek  changed:

   What|Removed |Added

   Priority|P3  |P2
   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org
 Status|NEW |ASSIGNED

[Bug c++/110106] [11/12/13/14 Regression] ICE on noexcept(noexcept(...)) with optional

2023-06-05 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110106

Marek Polacek  changed:

   What|Removed |Added

 CC||jason at gcc dot gnu.org,
   ||mpolacek at gcc dot gnu.org

--- Comment #4 from Marek Polacek  ---
Started with r11-557:

commit beb019d346b903c16b9fd349937de444b6a8b6c0
Author: Jason Merrill 
Date:   Thu May 21 10:27:11 2020 -0400

c++: Constant expression parsing and parameters.

[Bug c++/110106] [11/12/13/14 Regression] ICE on noexcept(noexcept(...)) with optional

2023-06-05 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110106

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |11.5

[Bug c++/110106] [11/12/13/14 Regression] ICE on noexcept(noexcept(...)) with optional

2023-06-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110106

--- Comment #3 from Andrew Pinski  ---
The full backtrace of the seg fault:
t0.cc:3:36: internal compiler error: Segmentation fault
3 | void y(j<0> z) noexcept(noexcept(g{z}));
  |^
0x128f4af crash_signal
/home/apinski/src/upstream-gcc-git/gcc/gcc/toplev.cc:314
0x7f37b9c54def ???
   
/usr/src/debug/glibc-2.34-60.el9.x86_64/signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0xa40753 tree_check(tree_node*, char const*, int, char const*, tree_code)
/home/apinski/src/upstream-gcc-git/gcc/gcc/tree.h:3539
0xa40753 is_really_empty_class(tree_node*, bool)
/home/apinski/src/upstream-gcc-git/gcc/gcc/cp/class.cc:8960
0xa6aa99 potential_constant_expression_1
/home/apinski/src/upstream-gcc-git/gcc/gcc/cp/constexpr.cc:9095
0xa69714 potential_constant_expression_1
/home/apinski/src/upstream-gcc-git/gcc/gcc/cp/constexpr.cc:9309
0xa6be0c potential_constant_expression_1(tree_node*, bool, bool, bool, bool,
int)
/home/apinski/src/upstream-gcc-git/gcc/gcc/cp/constexpr.cc:10131
0xa6be0c is_rvalue_constant_expression(tree_node*)
/home/apinski/src/upstream-gcc-git/gcc/gcc/cp/constexpr.cc:10215
0xba4e75 cp_parser_constant_expression
/home/apinski/src/upstream-gcc-git/gcc/gcc/cp/parser.cc:10801
0xba6301 cp_parser_initializer_clause
/home/apinski/src/upstream-gcc-git/gcc/gcc/cp/parser.cc:25522
0xba58e1 cp_parser_initializer_list
/home/apinski/src/upstream-gcc-git/gcc/gcc/cp/parser.cc:25812
0xba58e1 cp_parser_braced_list
/home/apinski/src/upstream-gcc-git/gcc/gcc/cp/parser.cc:25563
0xba8b4c cp_parser_functional_cast
/home/apinski/src/upstream-gcc-git/gcc/gcc/cp/parser.cc:32647
0xbb8547 cp_parser_postfix_expression
/home/apinski/src/upstream-gcc-git/gcc/gcc/cp/parser.cc:7703
0xba0d6b cp_parser_binary_expression
/home/apinski/src/upstream-gcc-git/gcc/gcc/cp/parser.cc:10147
0xba1c72 cp_parser_assignment_expression
/home/apinski/src/upstream-gcc-git/gcc/gcc/cp/parser.cc:10491
0xba41c3 cp_parser_expression
/home/apinski/src/upstream-gcc-git/gcc/gcc/cp/parser.cc:10661
0xbd6aa8 cp_parser_unary_expression
/home/apinski/src/upstream-gcc-git/gcc/gcc/cp/parser.cc:8937
0xba0d6b cp_parser_binary_expression
/home/apinski/src/upstream-gcc-git/gcc/gcc/cp/parser.cc:10147
0xba1c72 cp_parser_assignment_expression
/home/apinski/src/upstream-gcc-git/gcc/gcc/cp/parser.cc:10491
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug c++/110106] [11/12/13/14 Regression] ICE on noexcept(noexcept(...)) with optional

2023-06-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110106

--- Comment #2 from Andrew Pinski  ---
Reduced testcase:
```
template  struct j{ };
struct g {g(j<0>);};
void y(j<0> z) noexcept(noexcept(g{z}));
```

[Bug c++/110106] [11/12/13/14 Regression] ICE on noexcept(noexcept(...)) with optional

2023-06-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110106

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2023-06-03
 Status|UNCONFIRMED |NEW

--- Comment #1 from Andrew Pinski  ---
Slightly more reduced:
```
#include 

struct g
{
  g(int);
};

void y(std::optional z) noexcept(noexcept(g{z}));

```