public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/96961] New: ICE default lambda as non-type template with default argument
@ 2020-09-07 18:39 bastien.penavayre at epitech dot eu
  2020-09-11 13:30 ` [Bug c++/96961] " mpolacek at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: bastien.penavayre at epitech dot eu @ 2020-09-07 18:39 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96961
           Summary: ICE default lambda as non-type template with default
                    argument
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bastien.penavayre at epitech dot eu
  Target Milestone: ---

version:

g++ (Compiler-Explorer-Build) 11.0.0 20200906 (experimental)

error:

In instantiation of 'constexpr int in_template() [with auto X = <lambda closure
object>main()::<lambda(int)>{}]':
16:25:   required from here
9:13: internal compiler error: tree check: expected function_type or
method_type, have integer_type in set_flags_from_callee, at cp/call.c:328
9 |     return X();
  |            ~^~
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.

code:

#include <experimental/source_location>

using sl = std::experimental::source_location;
constexpr int line(sl s = sl::current()) { return s.line(); }

template<auto X = [](int i = line()){ return i; }>
constexpr int in_template() { return X(); }

template<auto> class p;

int main() { sizeof(p<in_template()>); }

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

* [Bug c++/96961] ICE default lambda as non-type template with default argument
  2020-09-07 18:39 [Bug c++/96961] New: ICE default lambda as non-type template with default argument bastien.penavayre at epitech dot eu
@ 2020-09-11 13:30 ` mpolacek at gcc dot gnu.org
  2021-08-21 12:43 ` pinskia at gcc dot gnu.org
  2021-08-21 12:44 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-09-11 13:30 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
                 CC|                            |mpolacek at gcc dot gnu.org
   Last reconfirmed|                            |2020-09-11
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.

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

* [Bug c++/96961] ICE default lambda as non-type template with default argument
  2020-09-07 18:39 [Bug c++/96961] New: ICE default lambda as non-type template with default argument bastien.penavayre at epitech dot eu
  2020-09-11 13:30 ` [Bug c++/96961] " mpolacek at gcc dot gnu.org
@ 2021-08-21 12:43 ` pinskia at gcc dot gnu.org
  2021-08-21 12:44 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-21 12:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hewillk at gmail dot com

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 102005 has been marked as a duplicate of this bug. ***

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

* [Bug c++/96961] ICE default lambda as non-type template with default argument
  2020-09-07 18:39 [Bug c++/96961] New: ICE default lambda as non-type template with default argument bastien.penavayre at epitech dot eu
  2020-09-11 13:30 ` [Bug c++/96961] " mpolacek at gcc dot gnu.org
  2021-08-21 12:43 ` pinskia at gcc dot gnu.org
@ 2021-08-21 12:44 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-21 12:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Reduced testcase from PR 102005:
int foo();

template<auto f = [](int = foo()){ }>
void bar() { f(); }

int main() {
  bar();
}

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

end of thread, other threads:[~2021-08-21 12:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-07 18:39 [Bug c++/96961] New: ICE default lambda as non-type template with default argument bastien.penavayre at epitech dot eu
2020-09-11 13:30 ` [Bug c++/96961] " mpolacek at gcc dot gnu.org
2021-08-21 12:43 ` pinskia at gcc dot gnu.org
2021-08-21 12:44 ` 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).