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

            Bug ID: 92777
           Summary: ICE on concept containing lambda with auto variable
                    declaration
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jason.e.cobb at gmail dot com
  Target Milestone: ---

With GCC trunk in std=c++2a mode and the following code:

[begin code]

template<typename>
concept auto_in_lambda = requires() {
    [](){
        auto x = 4;
    }();
};

static_assert(auto_in_lambda<int>);

[end code]

GCC ICEs with the following message:

<source>: In lambda function:
<source>:4:14: internal compiler error: in tsubst_decl, at cp/pt.c:14375
    4 |         auto x = 4;
      |              ^

GCC does not ICE if the concept is never instantiated, nor does it ICE if the
"auto" variable is changed to have a defined type.

On Compiler Explorer: https://godbolt.org/z/myujUX

Reply via email to