public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ky4ct at arrl dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/107278] New: fails to correctly parse template default function declarations.
Date: Sun, 16 Oct 2022 14:42:28 +0000	[thread overview]
Message-ID: <bug-107278-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 107278
           Summary: fails to correctly parse template default function
                    declarations.
           Product: gcc
           Version: 12.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ky4ct at arrl dot net
  Target Milestone: ---

Created attachment 53709
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53709&action=edit
minimal source code to reproduce the error.

This is specific to the -std=C++20 and -std=C++2b switches. The following
compiles fine by default and under C++ 11 and 14.

kd5eax@KY4CT UCRT64 ~
$ cat test.cpp
template<typename T>
class foo
{
        foo<T>(foo<T> const&) = delete;
        foo<T>(foo<T> const&&) = default;

};

int main()
{
        return 0;
};
kd5eax@KY4CT UCRT64 ~
$ g++ -std=c++20 test.cpp
test.cpp:4:22: error: expected ')' before 'const'
    4 |         foo<T>(foo<T> const&) = delete;
      |               ~      ^~~~~~
      |                      )
test.cpp:5:22: error: expected ')' before 'const'
    5 |         foo<T>(foo<T> const&&) = default;
      |               ~      ^~~~~~
      |                      )

kd5eax@KY4CT UCRT64 ~
$ g++ -v
Using built-in specs.
COLLECT_GCC=E:\msys64\ucrt64\bin\g++.exe
COLLECT_LTO_WRAPPER=E:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-12.2.0/configure --prefix=/ucrt64
--with-local-prefix=/ucrt64/local --build=x86_64-w64-mingw32
--host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32
--with-native-system-header-dir=/ucrt64/include --libexecdir=/ucrt64/lib
--enable-bootstrap --enable-checking=release --with-arch=x86-64
--with-tune=generic --enable-languages=c,lto,c++,fortran,ada,objc,obj-c++,jit
--enable-shared --enable-static --enable-libatomic --enable-threads=posix
--enable-graphite --enable-fully-dynamic-string
--enable-libstdcxx-filesystem-ts --enable-libstdcxx-time
--disable-libstdcxx-pch --enable-lto --enable-libgomp --disable-multilib
--disable-rpath --disable-win32-registry --disable-nls --disable-werror
--disable-symvers --with-libiconv --with-system-zlib --with-gmp=/ucrt64
--with-mpfr=/ucrt64 --with-mpc=/ucrt64 --with-isl=/ucrt64
--with-pkgversion='Rev1, Built by MSYS2 project'
--with-bugurl=https://github.com/msys2/MINGW-packages/issues --with-gnu-as
--with-gnu-ld --disable-libstdcxx-debug --with-boot-ldflags=-static-libstdc++
--with-stage1-ldflags=-static-libstdc++
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.0 (Rev1, Built by MSYS2 project)

             reply	other threads:[~2022-10-16 14:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-16 14:42 ky4ct at arrl dot net [this message]
2022-10-16 15:16 ` [Bug c++/107278] " pinskia at gcc dot gnu.org
2022-10-16 15:24 ` ky4ct at arrl dot net
2022-10-16 15:26 ` ky4ct at arrl dot net
2022-10-16 15:27 ` pinskia at gcc dot gnu.org
2022-10-16 15:29 ` ky4ct at arrl dot net
2022-10-16 15:42 ` pinskia at gcc dot gnu.org
2022-10-16 15:44 ` pinskia at gcc dot gnu.org
2022-10-16 15:47 ` ky4ct at arrl dot net

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-107278-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).