public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "tangyixuan at mail dot dlut.edu.cn" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/97202] New: GCC reports an error: expected unqualified-id before ‘short’
Date: Fri, 25 Sep 2020 08:05:20 +0000	[thread overview]
Message-ID: <bug-97202-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 97202
           Summary: GCC reports an error: expected unqualified-id before
                    ‘short’
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tangyixuan at mail dot dlut.edu.cn
  Target Milestone: ---

Hi, GCC 11 rejects the following code when the class 'A' is instantiated.  When
I fed it into GCC 1O, it is accepted. Also, clang accepts it. I guess maybe it
is valid.

$ cat s.cpp

template <class T> class A { 
  public:
    A(short,short a=0) {}
    A<T>(short b) {}
};

$ g++ -c s.cpp
s.cpp:4:10: error: expected unqualified-id before ‘short’
    4 |     A<T>(short b) {}
      |          ^~~~~
s.cpp:4:10: error: expected ‘)’ before ‘short’
    4 |     A<T>(short b) {}
      |         ~^~~~~
      |          )


$ g++ -v
Using built-in specs.
COLLECT_GCC=/usr/local/gcc-20200920/bin/g++
COLLECT_LTO_WRAPPER=/usr/local/gcc-20200920/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-11-20200920/configure --prefix=/usr/local/gcc-20200920
--enable-checking=release --enable-languages=c,c++ --disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.0.0 20200920 (experimental) (GCC)

             reply	other threads:[~2020-09-25  8:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-25  8:05 tangyixuan at mail dot dlut.edu.cn [this message]
2020-09-25  8:27 ` [Bug c++/97202] [11 Regression] " rguenth at gcc dot gnu.org
2020-09-25  8:40 ` pinskia at gcc dot gnu.org
2020-09-25 13:16 ` mpolacek at gcc dot gnu.org
2020-09-25 13:20 ` [Bug c++/97202] " mpolacek at gcc dot gnu.org
2020-09-25 13:21 ` mpolacek at gcc dot gnu.org
2021-06-09 17:12 ` mpolacek at gcc dot gnu.org
2021-06-11 16:54 ` redi at gcc dot gnu.org
2021-06-11 16:58 ` redi at gcc dot gnu.org
2022-02-08 10:15 ` redi at gcc dot gnu.org
2022-02-08 10:17 ` redi at gcc dot gnu.org
2024-02-10 13:38 ` cvs-commit at gcc dot gnu.org
2024-02-10 13:43 ` mpolacek at gcc dot gnu.org
2024-04-21 21:38 ` pinskia at gcc dot gnu.org

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-97202-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).