public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/112633] New: ICE in parser GCC 13+ (including 14) around type aliases
@ 2023-11-20  6:27 hanicka at hanicka dot net
  2023-11-20  6:47 ` [Bug c++/112633] [13/14 Regression] ICE with type aliases and depedent value pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: hanicka at hanicka dot net @ 2023-11-20  6:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112633

            Bug ID: 112633
           Summary: ICE in parser GCC 13+ (including 14) around type
                    aliases
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hanicka at hanicka dot net
  Target Milestone: ---

Tested on GCC 14.0.0 20231119 (on Compiler-Explorer) and it's giving me ICE,
also on all 13.x versions (not 12.x)

```c++
template <class> constexpr bool dependent_true = true;

template <bool> struct empty_type { }; // something like enable_if

template <bool B> using empty_type_t = typename empty_type<B>::type; 

struct wrapper {
    using type = void;
};

template <class...> using all = wrapper;

template <class... Conditions>
using constraints = typename all<Conditions...>::type;

template <typename T, constraints<empty_type_t<dependent_true<T>>> = nullptr> 
void calculate() { };
```

I don't even need to instantiate `calculate` function.

It gives me this error:

<source>: In substitution of 'template<class ... Conditions> using constraints
= typename all<Conditions ...>::type [with Conditions = {typename
empty_type<dependent_true<T> >::type}]':
<source>:16:66:   required from here
   16 | template <typename T, constraints<empty_type_t<dependent_true<T>>> =
nullptr>
      |                                                                  ^
<source>:14:7: internal compiler error: Segmentation fault
   14 | using constraints = typename all<Conditions...>::type;
      |       ^~~~~~~~~~~
0x26a742e internal_error(char const*, ...)
        ???:0
0xd276f0 tsubst(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xd1b8f3 instantiate_template(tree_node*, tree_node*, int)
        ???:0
0xd285ea tsubst(tree_node*, tree_node*, int, tree_node*)
        ???:0
0xd35ed6 lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
        ???:0
0xd6996f finish_template_type(tree_node*, tree_node*, int)
        ???:0
0xcf6a49 c_parse_file()
        ???:0
0xe38e79 c_common_parse_file()
        ???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-11-27 22:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-20  6:27 [Bug c++/112633] New: ICE in parser GCC 13+ (including 14) around type aliases hanicka at hanicka dot net
2023-11-20  6:47 ` [Bug c++/112633] [13/14 Regression] ICE with type aliases and depedent value pinskia at gcc dot gnu.org
2023-11-20  6:47 ` pinskia at gcc dot gnu.org
2023-11-20 14:31 ` ppalka at gcc dot gnu.org
2023-11-22 18:54 ` cvs-commit at gcc dot gnu.org
2023-11-22 19:11 ` hanicka at hanicka dot net
2023-11-23  0:08 ` cvs-commit at gcc dot gnu.org
2023-11-27 22:19 ` ppalka at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).