public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/111222] New: ICE on basic_string_view with missing template argument
@ 2023-08-29  6:01 stevenxia990430 at gmail dot com
  2023-08-29  6:06 ` [Bug c++/111222] ICE on basic_string_view and alias templates " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: stevenxia990430 at gmail dot com @ 2023-08-29  6:01 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111222
           Summary: ICE on basic_string_view with missing template
                    argument
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: stevenxia990430 at gmail dot com
  Target Milestone: ---

The following invalid program reports an internal compiler error. Failed on
gcc-trunk. 

To quickly reproduce: https://gcc.godbolt.org/z/To8EdvdhM
```
#include <string_view>

template <typename T>
using string_view = std::basic_string_view<T>;

string_view my_string = "12345";
```

note after providing the valid declaration (i.e., string_view<char> my_string =
"12345";) the program compiles successfully

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

* [Bug c++/111222] ICE on basic_string_view and alias templates with missing template argument
  2023-08-29  6:01 [Bug c++/111222] New: ICE on basic_string_view with missing template argument stevenxia990430 at gmail dot com
@ 2023-08-29  6:06 ` pinskia at gcc dot gnu.org
  2023-08-29  6:08 ` stevenxia990430 at gmail dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-08-29  6:06 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid
            Summary|[c++23] ICE on              |ICE on basic_string_view
                   |basic_string_view with      |and alias templates with
                   |missing template argument   |missing template argument

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Hmm, we have an accepts invalid here too. For C++20 we accept it but deduction
for alias templates is not valid ...

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

* [Bug c++/111222] ICE on basic_string_view and alias templates with missing template argument
  2023-08-29  6:01 [Bug c++/111222] New: ICE on basic_string_view with missing template argument stevenxia990430 at gmail dot com
  2023-08-29  6:06 ` [Bug c++/111222] ICE on basic_string_view and alias templates " pinskia at gcc dot gnu.org
@ 2023-08-29  6:08 ` stevenxia990430 at gmail dot com
  2023-10-13 18:44 ` mpolacek at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: stevenxia990430 at gmail dot com @ 2023-08-29  6:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Steven Xia <stevenxia990430 at gmail dot com> ---
interesting

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

* [Bug c++/111222] ICE on basic_string_view and alias templates with missing template argument
  2023-08-29  6:01 [Bug c++/111222] New: ICE on basic_string_view with missing template argument stevenxia990430 at gmail dot com
  2023-08-29  6:06 ` [Bug c++/111222] ICE on basic_string_view and alias templates " pinskia at gcc dot gnu.org
  2023-08-29  6:08 ` stevenxia990430 at gmail dot com
@ 2023-10-13 18:44 ` mpolacek at gcc dot gnu.org
  2023-10-13 18:51 ` ppalka at gcc dot gnu.org
  2024-02-02 17:59 ` ppalka at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2023-10-13 18:44 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2023-10-13
     Ever confirmed|0                           |1
                 CC|                            |mpolacek at gcc dot gnu.org,
                   |                            |ppalka at gcc dot gnu.org

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I think the ICE below started with r11-3261.


In file included from 111222.C:1:
/home/mpolacek/x/gcc11/x86_64-pc-linux-gnu/libstdc++-v3/include/string_view:158:16:
internal compiler error: in add_outermost_template_args, at cp/pt.c:601
  158 |           && (!requires (_DRange& __d) {
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~
  159 |                 __d.operator ::std::basic_string_view<_CharT,
_Traits>();
      |                
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  160 |               })
      |               ~ 
0xd52027 add_outermost_template_args(tree_node*, tree_node*)
        /home/mpolacek/src/gcc11/gcc/cp/pt.c:601
0xd8838e add_extra_args(tree_node*, tree_node*, int, tree_node*)
        /home/mpolacek/src/gcc11/gcc/cp/pt.c:13103
0xb1d061 tsubst_requires_expr
        /home/mpolacek/src/gcc11/gcc/cp/constraint.cc:2310
0xb1d30c tsubst_requires_expr(tree_node*, tree_node*, int, tree_node*)
        /home/mpolacek/src/gcc11/gcc/cp/constraint.cc:2353
0xdb6406 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        /home/mpolacek/src/gcc11/gcc/cp/pt.c:21116
0xdb09af tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        /home/mpolacek/src/gcc11/gcc/cp/pt.c:20035
0xdb0c91 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        /home/mpolacek/src/gcc11/gcc/cp/pt.c:20102
0xdb0c57 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        /home/mpolacek/src/gcc11/gcc/cp/pt.c:20101
0xdadc55 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/mpolacek/src/gcc11/gcc/cp/pt.c:19382
0xb1e33e tsubst_constraint(tree_node*, tree_node*, int, tree_node*)
        /home/mpolacek/src/gcc11/gcc/cp/constraint.cc:2761
0xb1d390 tsubst_constraint_info(tree_node*, tree_node*, int, tree_node*)
        /home/mpolacek/src/gcc11/gcc/cp/constraint.cc:2366
0xdd8ae3 alias_ctad_tweaks
        /home/mpolacek/src/gcc11/gcc/cp/pt.c:29355
0xdd93f8 deduction_guides_for
        /home/mpolacek/src/gcc11/gcc/cp/pt.c:29488
0xdd9efe do_class_deduction
        /home/mpolacek/src/gcc11/gcc/cp/pt.c:29611
0xddae07 do_auto_deduction(tree_node*, tree_node*, tree_node*, int,
auto_deduction_context, tree_node*, int)
        /home/mpolacek/src/gcc11/gcc/cp/pt.c:29781
0xb91d12 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
        /home/mpolacek/src/gcc11/gcc/cp/decl.c:7899
0xd05934 cp_parser_init_declarator
        /home/mpolacek/src/gcc11/gcc/cp/parser.c:21931
0xcf750b cp_parser_simple_declaration
        /home/mpolacek/src/gcc11/gcc/cp/parser.c:14476
0xcf70c7 cp_parser_block_declaration
        /home/mpolacek/src/gcc11/gcc/cp/parser.c:14302
0xcf6d80 cp_parser_declaration
        /home/mpolacek/src/gcc11/gcc/cp/parser.c:14173

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

* [Bug c++/111222] ICE on basic_string_view and alias templates with missing template argument
  2023-08-29  6:01 [Bug c++/111222] New: ICE on basic_string_view with missing template argument stevenxia990430 at gmail dot com
                   ` (2 preceding siblings ...)
  2023-10-13 18:44 ` mpolacek at gcc dot gnu.org
@ 2023-10-13 18:51 ` ppalka at gcc dot gnu.org
  2024-02-02 17:59 ` ppalka at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: ppalka at gcc dot gnu.org @ 2023-10-13 18:51 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |ppalka at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

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

* [Bug c++/111222] ICE on basic_string_view and alias templates with missing template argument
  2023-08-29  6:01 [Bug c++/111222] New: ICE on basic_string_view with missing template argument stevenxia990430 at gmail dot com
                   ` (3 preceding siblings ...)
  2023-10-13 18:51 ` ppalka at gcc dot gnu.org
@ 2024-02-02 17:59 ` ppalka at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: ppalka at gcc dot gnu.org @ 2024-02-02 17:59 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
           See Also|https://gcc.gnu.org/bugzill |
                   |a/show_bug.cgi?id=112769    |
             Status|ASSIGNED                    |RESOLVED

--- Comment #4 from Patrick Palka <ppalka at gcc dot gnu.org> ---
The underlying bug is the same as PR112769 which is a regression, so let's call
this one a dup.

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

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

end of thread, other threads:[~2024-02-02 17:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-29  6:01 [Bug c++/111222] New: ICE on basic_string_view with missing template argument stevenxia990430 at gmail dot com
2023-08-29  6:06 ` [Bug c++/111222] ICE on basic_string_view and alias templates " pinskia at gcc dot gnu.org
2023-08-29  6:08 ` stevenxia990430 at gmail dot com
2023-10-13 18:44 ` mpolacek at gcc dot gnu.org
2023-10-13 18:51 ` ppalka at gcc dot gnu.org
2024-02-02 17:59 ` 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).