public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/99675] New: internal compiler error during template deduction
@ 2021-03-19 21:55 lnwirz at chem dot helsinki.fi
  2021-03-20 19:51 ` [Bug c++/99675] [11 Regression] ICE during template deduction since r10-5020-g1a291106384cabc7 marxin at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: lnwirz at chem dot helsinki.fi @ 2021-03-19 21:55 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99675
           Summary: internal compiler error during template deduction
           Product: gcc
           Version: 10.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lnwirz at chem dot helsinki.fi
  Target Milestone: ---

Created attachment 50436
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50436&action=edit
the code file, saved temps

Hi folks,

When compiling the attached (fairly) minimal example with g++-10.2.1
(debian/testing) with

g++ --std=c++17 bug1.cpp

I get

bug1.cpp: In function ‘void lala()’:
bug1.cpp:20:19: warning: alias template deduction only available with
‘-std=c++2a’ or ‘-std=gnu++2a’
   20 |   vec3 foo(1, 2, 3);
      |                   ^
bug1.cpp:20:19: internal compiler error: in set_constraints, at
cp/constraint.cc:1191
0x7fcbcfa72d09 __libc_start_main
        ../csu/libc-start.c:308
Please submit a full bug report,

In g++-10.2.1 as shipped by debian testing, the std=c++17 is required for the
failure.  Comparing with compiler explorer (https://gcc.godbolt.org/z/d3dTff)
shows that in trunk not even the c++17 argument is required and the output is


source>: In function 'void lala()':
<source>:20:19: warning: alias template deduction only available with
'-std=c++20' or '-std=gnu++20'
   20 |   vec3 foo(1, 2, 3);
      |                   ^
<source>:20:19: internal compiler error: in set_constraints, at
cp/constraint.cc:1255
0x1cfa259 internal_error(char const*, ...)
        ???:0
0x6ba797 fancy_abort(char const*, int, char const*)
        ???:0
0x73f122 set_constraints(tree_node*, tree_node*)
        ???:0
0x909361 do_auto_deduction(tree_node*, tree_node*, tree_node*, int,
auto_deduction_context, tree_node*, int)
        ???:0
0x7b2164 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
        ???:0
0x8e136d c_parse_file()
        ???:0
0xa5f962 c_common_parse_file()
        ???:0
Please submit a full bug report,


let me know if more information is required.

cheers, Lukas Wirz

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

* [Bug c++/99675] [11 Regression] ICE during template deduction since r10-5020-g1a291106384cabc7
  2021-03-19 21:55 [Bug c++/99675] New: internal compiler error during template deduction lnwirz at chem dot helsinki.fi
@ 2021-03-20 19:51 ` marxin at gcc dot gnu.org
  2021-03-22  8:53 ` [Bug c++/99675] [10/11 " rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-03-20 19:51 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-03-20
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org
      Known to fail|                            |11.0
            Summary|internal compiler error     |[11 Regression] ICE during
                   |during template deduction   |template deduction since
                   |                            |r10-5020-g1a291106384cabc7
      Known to work|                            |10.2.0

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Reduced test-case:

namespace std {
template <typename> struct common_type;
template <typename... _Tp>
using common_type_t = typename common_type<_Tp...>::type;
} // namespace std
template <typename T, int> class vec {
public:
  vec(T, T, T);
};
template <typename... Args>
vec() -> vec<std::common_type_t<Args...>, sizeof...(Args)>;
template <typename T> using vec3 = vec<T, 3>;
void lala() { vec3(1, 2, 3); }

started with r10-5020-g1a291106384cabc7.

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

* [Bug c++/99675] [10/11 Regression] ICE during template deduction since r10-5020-g1a291106384cabc7
  2021-03-19 21:55 [Bug c++/99675] New: internal compiler error during template deduction lnwirz at chem dot helsinki.fi
  2021-03-20 19:51 ` [Bug c++/99675] [11 Regression] ICE during template deduction since r10-5020-g1a291106384cabc7 marxin at gcc dot gnu.org
@ 2021-03-22  8:53 ` rguenth at gcc dot gnu.org
  2021-04-08 12:02 ` rguenth at gcc dot gnu.org
  2021-04-10  6:20 ` jason at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-03-22  8:53 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[11 Regression] ICE during  |[10/11 Regression] ICE
                   |template deduction since    |during template deduction
                   |r10-5020-g1a291106384cabc7  |since
                   |                            |r10-5020-g1a291106384cabc7
   Target Milestone|---                         |10.3
           Priority|P3                          |P2
      Known to work|10.2.0                      |
      Known to fail|                            |10.2.0

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

* [Bug c++/99675] [10/11 Regression] ICE during template deduction since r10-5020-g1a291106384cabc7
  2021-03-19 21:55 [Bug c++/99675] New: internal compiler error during template deduction lnwirz at chem dot helsinki.fi
  2021-03-20 19:51 ` [Bug c++/99675] [11 Regression] ICE during template deduction since r10-5020-g1a291106384cabc7 marxin at gcc dot gnu.org
  2021-03-22  8:53 ` [Bug c++/99675] [10/11 " rguenth at gcc dot gnu.org
@ 2021-04-08 12:02 ` rguenth at gcc dot gnu.org
  2021-04-10  6:20 ` jason at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-04-08 12:02 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.3                        |10.4

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10.3 is being released, retargeting bugs to GCC 10.4.

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

* [Bug c++/99675] [10/11 Regression] ICE during template deduction since r10-5020-g1a291106384cabc7
  2021-03-19 21:55 [Bug c++/99675] New: internal compiler error during template deduction lnwirz at chem dot helsinki.fi
                   ` (2 preceding siblings ...)
  2021-04-08 12:02 ` rguenth at gcc dot gnu.org
@ 2021-04-10  6:20 ` jason at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jason at gcc dot gnu.org @ 2021-04-10  6:20 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed already, probably by the patch for 95486.

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

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

end of thread, other threads:[~2021-04-10  6:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-19 21:55 [Bug c++/99675] New: internal compiler error during template deduction lnwirz at chem dot helsinki.fi
2021-03-20 19:51 ` [Bug c++/99675] [11 Regression] ICE during template deduction since r10-5020-g1a291106384cabc7 marxin at gcc dot gnu.org
2021-03-22  8:53 ` [Bug c++/99675] [10/11 " rguenth at gcc dot gnu.org
2021-04-08 12:02 ` rguenth at gcc dot gnu.org
2021-04-10  6:20 ` jason 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).