public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/93297] internal compiler error: in set_constraints, at cp/constraint.cc:
       [not found] <bug-93297-4@http.gcc.gnu.org/bugzilla/>
@ 2020-10-19 22:04 ` john at mcfarlane dot name
  2020-10-19 22:13 ` john at mcfarlane dot name
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 4+ messages in thread
From: john at mcfarlane dot name @ 2020-10-19 22:04 UTC (permalink / raw)
  To: gcc-bugs

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

John McFarlane <john at mcfarlane dot name> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |john at mcfarlane dot name

--- Comment #7 from John McFarlane <john at mcfarlane dot name> ---
I'm seeing what appears to be the same ICE at head (SHA b003c4b1). This is
reproducible in CE (https://godbolt.org/z/MG1sax). Output with `-v` below.

Source file is:

    template <class> class a;
    template <2> using b a<int>;
    static_assert(b{       }

=========================
john@carbon:~/ws/c++20/cnl/build$ g++ -v reduceme.cpp
Using built-in specs.
COLLECT_GCC=/usr/bin/g++
COLLECT_LTO_WRAPPER=/home/john/gcc-head/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --disable-multilib
--prefix=/home/john/gcc-head/ --enable-languages=c,c++,lto
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.0.0 20201019 (experimental) (GCC) 
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
'-dumpdir' 'a-'
 /home/john/gcc-head/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/cc1plus -quiet -v
-imultiarch x86_64-linux-gnu -D_GNU_SOURCE reduceme.cpp -quiet -dumpdir a-
-dumpbase reduceme.cpp -dumpbase-ext .cpp -mtune=generic -march=x86-64 -version
-o /tmp/ccBQ8tty.s
GNU C++17 (GCC) version 11.0.0 20201019 (experimental) (x86_64-pc-linux-gnu)
        compiled by GNU C version 11.0.0 20201019 (experimental), GMP version
6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version none
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
ignoring non-existent directory "/usr/local/include/x86_64-linux-gnu"
ignoring non-existent directory
"/home/john/gcc-head/lib/gcc/x86_64-pc-linux-gnu/11.0.0/../../../../x86_64-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:

/home/john/gcc-head/lib/gcc/x86_64-pc-linux-gnu/11.0.0/../../../../include/c++/11.0.0

/home/john/gcc-head/lib/gcc/x86_64-pc-linux-gnu/11.0.0/../../../../include/c++/11.0.0/x86_64-pc-linux-gnu

/home/john/gcc-head/lib/gcc/x86_64-pc-linux-gnu/11.0.0/../../../../include/c++/11.0.0/backward
 /home/john/gcc-head/lib/gcc/x86_64-pc-linux-gnu/11.0.0/include
 /usr/local/include
 /home/john/gcc-head/include
 /home/john/gcc-head/lib/gcc/x86_64-pc-linux-gnu/11.0.0/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
GNU C++17 (GCC) version 11.0.0 20201019 (experimental) (x86_64-pc-linux-gnu)
        compiled by GNU C version 11.0.0 20201019 (experimental), GMP version
6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version none
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 898bda479bba6f05660e15f0cb7d4838
reduceme.cpp:2:11: error: expected identifier before numeric constant
    2 | template <2> using b a<int>;
      |           ^
reduceme.cpp:2:11: error: expected ‘>’ before numeric constant
reduceme.cpp:2:22: error: expected ‘=’ before ‘a’
    2 | template <2> using b a<int>;
      |                      ^
reduceme.cpp:3:52: warning: alias template deduction only available with
‘-std=c++20’ or ‘-std=gnu++20’
    3 |                             static_assert(b{       }
      |                                                    ^
reduceme.cpp:3:52: internal compiler error: in set_constraints, at
cp/constraint.cc:1192
0x63dc05 set_constraints(tree_node*, tree_node*)
        ../../gcc/gcc/cp/constraint.cc:1192
0xa37768 alias_ctad_tweaks
        ../../gcc/gcc/cp/pt.c:28819
0xa37768 deduction_guides_for
        ../../gcc/gcc/cp/pt.c:28934
0xa37a98 do_class_deduction
        ../../gcc/gcc/cp/pt.c:29042
0xa37a98 do_auto_deduction(tree_node*, tree_node*, tree_node*, int,
auto_deduction_context, tree_node*, int)
        ../../gcc/gcc/cp/pt.c:29211
0xa8b289 finish_compound_literal(tree_node*, tree_node*, int, fcl_t)
        ../../gcc/gcc/cp/semantics.c:2934
0x9e7f7a cp_parser_functional_cast
        ../../gcc/gcc/cp/parser.c:29749
0xa005d7 cp_parser_postfix_expression
        ../../gcc/gcc/cp/parser.c:7251
0x9e229a cp_parser_binary_expression
        ../../gcc/gcc/cp/parser.c:9648
0x9e402e cp_parser_assignment_expression
        ../../gcc/gcc/cp/parser.c:9953
0x9e2bad cp_parser_constant_expression
        ../../gcc/gcc/cp/parser.c:10247
0x9e2f11 cp_parser_static_assert
        ../../gcc/gcc/cp/parser.c:14829
0xa1bfe6 cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:13575
0xa1c63b cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:4793
0xa1c63b c_parse_file()
        ../../gcc/gcc/cp/parser.c:44170
0xb3948d c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1188
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
=========================

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

* [Bug c++/93297] internal compiler error: in set_constraints, at cp/constraint.cc:
       [not found] <bug-93297-4@http.gcc.gnu.org/bugzilla/>
  2020-10-19 22:04 ` [Bug c++/93297] internal compiler error: in set_constraints, at cp/constraint.cc: john at mcfarlane dot name
@ 2020-10-19 22:13 ` john at mcfarlane dot name
  2020-10-22 23:12 ` john at mcfarlane dot name
  2021-12-26  6:02 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: john at mcfarlane dot name @ 2020-10-19 22:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from John McFarlane <john at mcfarlane dot name> ---
And this input can generate an ICE even with the -std=c++2a switch:

   template <class> class a;
   template <b> a()->a;
   template <2> using c a<int>;
   static_assert(c{       }

CL: g++ -v -std=c++2a source.cpp
Online: https://godbolt.org/z/dh9bfc

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

* [Bug c++/93297] internal compiler error: in set_constraints, at cp/constraint.cc:
       [not found] <bug-93297-4@http.gcc.gnu.org/bugzilla/>
  2020-10-19 22:04 ` [Bug c++/93297] internal compiler error: in set_constraints, at cp/constraint.cc: john at mcfarlane dot name
  2020-10-19 22:13 ` john at mcfarlane dot name
@ 2020-10-22 23:12 ` john at mcfarlane dot name
  2021-12-26  6:02 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: john at mcfarlane dot name @ 2020-10-22 23:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from John McFarlane <john at mcfarlane dot name> ---
And here is an ICE in 10.2: 

   struct a;
   template <typename = int> class b;
   template <class> b()->b<>;
   template <int> using c = b<a>;
   static_assert(c{}

CL: g++ -v -std=c++2a source.cpp
Online: https://godbolt.org/z/54aTr6

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

* [Bug c++/93297] internal compiler error: in set_constraints, at cp/constraint.cc:
       [not found] <bug-93297-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2020-10-22 23:12 ` john at mcfarlane dot name
@ 2021-12-26  6:02 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-26  6:02 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.0
             Status|WAITING                     |RESOLVED
         Resolution|---                         |FIXED

--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to John McFarlane from comment #9)
> And here is an ICE in 10.2: 
> 
>    struct a;
>    template <typename = int> class b;
>    template <class> b()->b<>;
>    template <int> using c = b<a>;
>    static_assert(c{}

This is a dup of bug 95486  which is fixed in GCC 10.4.

All of the rest of the ICEs are fixed for GCC 11.1.0 (some might be fixed in
GCC 10.4 but I have not tried that yet).

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

end of thread, other threads:[~2021-12-26  6:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-93297-4@http.gcc.gnu.org/bugzilla/>
2020-10-19 22:04 ` [Bug c++/93297] internal compiler error: in set_constraints, at cp/constraint.cc: john at mcfarlane dot name
2020-10-19 22:13 ` john at mcfarlane dot name
2020-10-22 23:12 ` john at mcfarlane dot name
2021-12-26  6:02 ` pinskia 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).