public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/112482] New: error when auto(x) is used in a variable initializer (block scope)
@ 2023-11-11  0:01 mpolacek at gcc dot gnu.org
  2023-11-11  0:01 ` [Bug c++/112482] " mpolacek at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2023-11-11  0:01 UTC (permalink / raw)
  To: gcc-bugs

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);
      |        ^~~~

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

end of thread, other threads:[~2023-12-14 21:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-11  0:01 [Bug c++/112482] New: error when auto(x) is used in a variable initializer (block scope) mpolacek at gcc dot gnu.org
2023-11-11  0:01 ` [Bug c++/112482] " mpolacek at gcc dot gnu.org
2023-12-14 21:40 ` cvs-commit at gcc dot gnu.org
2023-12-14 21:42 ` 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).