public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/104319] New: "parse error of template argument list" due to missing space in ">==", a better error message should be given
@ 2022-02-01  0:47 nickhuang99 at hotmail dot com
  2022-02-01  0:52 ` [Bug c++/104319] better error message for parsing error when >= ends a template variable pinskia at gcc dot gnu.org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: nickhuang99 at hotmail dot com @ 2022-02-01  0:47 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104319
           Summary: "parse error of template argument list" due to missing
                    space in ">==", a better error message should be given
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nickhuang99 at hotmail dot com
  Target Milestone: ---

consider following code (https://www.godbolt.org/z/4drb17Pqn):

template<typename T>
struct A{ 
    constexpr static int value=0;
};

template<typename T>
constexpr int Zero=A<T>::value;
static_assert(Zero<int>==0);

<source>:8:15: error: parse error in template argument list
    8 | static_assert(Zero<int>==0);
      |               ^~~~~~~~~~~~
<source>:8:15: error: template argument 1 is invalid
Compiler returned: 1


clang gives much clear reason: 
error: a space is required between a right angle bracket and an equals sign
(use '> =')
static_assert(Zero<int>==0);
                      ^~
                      > =

clearly "Zero<int>" can be considered template id to avoid template argument
list error message.

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

end of thread, other threads:[~2022-04-29 11:52 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-01  0:47 [Bug c++/104319] New: "parse error of template argument list" due to missing space in ">==", a better error message should be given nickhuang99 at hotmail dot com
2022-02-01  0:52 ` [Bug c++/104319] better error message for parsing error when >= ends a template variable pinskia at gcc dot gnu.org
2022-02-02 21:30 ` nickhuang99 at hotmail dot com
2022-02-02 21:36 ` [Bug c++/104319] better error message for parsing error when >= or >> " pinskia at gcc dot gnu.org
2022-02-02 21:48 ` jakub at gcc dot gnu.org
2022-02-02 21:56 ` pinskia at gcc dot gnu.org
2022-02-03  1:45 ` nickhuang99 at hotmail dot com
2022-02-03 10:41 ` jakub at gcc dot gnu.org
2022-02-03 11:13 ` jakub at gcc dot gnu.org
2022-02-03 15:40 ` jakub at gcc dot gnu.org
2022-02-03 20:01 ` nickhuang99 at hotmail dot com
2022-02-08 14:01 ` jakub at gcc dot gnu.org
2022-04-29 11:51 ` cvs-commit at gcc dot gnu.org
2022-04-29 11:52 ` jakub 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).