public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/115412] New: ICE: canonical types differ for identical types ‘stdis_sametypename fooTtype, U’ and ‘stdis_sameT, U’
@ 2024-06-10  7:15 iamanonymous.cs at gmail dot com
  2024-06-10 16:58 ` [Bug c++/115412] " mpolacek at gcc dot gnu.org
  2024-06-10 17:23 ` mpolacek at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: iamanonymous.cs at gmail dot com @ 2024-06-10  7:15 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115412
           Summary: ICE: canonical types differ for identical types
                    ‘stdis_sametypename fooTtype, U’ and ‘stdis_sameT, U’
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

*******************************************************************************
The compiler produces an internal error when compiling the provided code with
the specified options. 
The issue involves canonical types differing for identical types during
template instantiation.
*******************************************************************************
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
*******************************************************************************
# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 
*******************************************************************************
Program:
# cat main.cpp

 #include <type_traits>

 template<typename T>
 struct foo {
     using type = T;

     template<
         typename U
         , typename std::enable_if<
             std::is_same<type, U>::value
             , int
         >::type = 0
     >
     void bar(U&&);
 };

 template<typename T>
 template<
     typename U
     , typename std::enable_if<
         std::is_same<typename foo<T>::type, U>::value
         , int
     >::type
 >
 void foo<T>::bar(U&&) {}

 int
 main()
 {}



*******************************************************************************
Command Lines:
# g++ main.cpp -O1 -c -o main.out

main.cpp:25:22: internal compiler error: canonical types differ for identical
types ‘std::is_same<typename foo<T>::type, U>’ and ‘std::is_same<T, U>’
   25 |  void foo<T>::bar(U&&) {}
      |                      ^
0xd499c9 comptypes(tree_node*, tree_node*, int)
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/typeck.cc:1710
0xd3cf8b cp_tree_equal(tree_node*, tree_node*)
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/tree.cc:4309
0xc9c3da template_args_equal(tree_node*, tree_node*)
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:9473
0xc9c105 template_args_equal(tree_node*, tree_node*)
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:9418
0xc9c105 comp_template_args(tree_node*, tree_node*, tree_node**, tree_node**)
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:9499
0xd49826 structural_comptypes
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/typeck.cc:1522
0xd4993d comptypes(tree_node*, tree_node*, int)
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/typeck.cc:1703
0xd49748 structural_comptypes
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/typeck.cc:1590
0xc99b2f comp_template_parms(tree_node const*, tree_node const*)
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:3349
0xb8361a check_classfn(tree_node*, tree_node*, tree_node*)
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/decl2.cc:878
0xb627e3 grokfndecl
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/decl.cc:11045
0xb69a7b grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/decl.cc:15114
0xb6d066 start_function(cp_decl_specifier_seq*, cp_declarator const*,
tree_node*)
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/decl.cc:18212
0xc83107 cp_parser_function_definition_from_specifiers_and_declarator
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:32780
0xc83107 cp_parser_init_declarator
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:23451
0xc8ae60 cp_parser_single_declaration
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:33420
0xc8b01c cp_parser_template_declaration_after_parameters
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:32973
0xc8b900 cp_parser_explicit_template_declaration
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:33246
0xc8b2e5 cp_parser_template_declaration_after_export
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:33265
0xc8b2e5 cp_parser_template_declaration_after_parameters
        /root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:32959
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.

*******************************************************************************
Also ICE on trunk, compiler explorer: https://godbolt.org/z/nzKP3Eovr

*******************************************************************************

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

* [Bug c++/115412] ICE: canonical types differ for identical types ‘stdis_sametypename fooTtype, U’ and ‘stdis_sameT, U’
  2024-06-10  7:15 [Bug c++/115412] New: ICE: canonical types differ for identical types ‘stdis_sametypename fooTtype, U’ and ‘stdis_sameT, U’ iamanonymous.cs at gmail dot com
@ 2024-06-10 16:58 ` mpolacek at gcc dot gnu.org
  2024-06-10 17:23 ` mpolacek at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2024-06-10 16:58 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
This goes all the way back to r0-113135-g28704289327e42

commit 28704289327e4295928663b5bab7953718f71bc1
Author:     Dodji Seketeli <dodji@gcc.gnu.org>
AuthorDate: Mon Nov 7 22:28:50 2011 +0100
Commit:     Dodji Seketeli <dodji@gcc.gnu.org>
CommitDate: Mon Nov 7 22:28:50 2011 +0100

    PR c++/45114 - Support C++11 alias-declaration

Most likely a dup.

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

* [Bug c++/115412] ICE: canonical types differ for identical types ‘stdis_sametypename fooTtype, U’ and ‘stdis_sameT, U’
  2024-06-10  7:15 [Bug c++/115412] New: ICE: canonical types differ for identical types ‘stdis_sametypename fooTtype, U’ and ‘stdis_sameT, U’ iamanonymous.cs at gmail dot com
  2024-06-10 16:58 ` [Bug c++/115412] " mpolacek at gcc dot gnu.org
@ 2024-06-10 17:23 ` mpolacek at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2024-06-10 17:23 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-06-10
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I haven't found a dup, so confirmed.

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

end of thread, other threads:[~2024-06-10 17:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-10  7:15 [Bug c++/115412] New: ICE: canonical types differ for identical types ‘stdis_sametypename fooTtype, U’ and ‘stdis_sameT, U’ iamanonymous.cs at gmail dot com
2024-06-10 16:58 ` [Bug c++/115412] " mpolacek at gcc dot gnu.org
2024-06-10 17:23 ` mpolacek 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).