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

            Bug ID: 112482
           Summary: error when auto(x) is used in a variable initializer
                    (block scope)
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

Discovered while working on bug 112410.  It's very similar, but the underlying
issue is different.

// { dg-do compile { target c++23 } }

struct A {
   A(int,int);
};

void
g (int a)
{
  A b2(auto(a), 42);
}

$ xg++ -c auto-fncast15.C -std=c++23
auto-fncast15.C: In function ‘void g(int)’:
auto-fncast15.C:10:8: error: ‘auto’ parameter not permitted in this context
   10 |   A b2(auto(a), 42);
      |        ^~~~

Reply via email to