public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/96082] New: GCC rejects the template disambiguator with "typename"
@ 2020-07-06 15:59 haoxintu at gmail dot com
  2020-07-07  7:22 ` [Bug c++/96082] [9/10/11 Regression] " rguenth at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: haoxintu at gmail dot com @ 2020-07-06 15:59 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96082
           Summary: GCC rejects the template disambiguator with "typename"
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: haoxintu at gmail dot com
  Target Milestone: ---

Hi, all.

This code, test.cc, GCC rejects it in versions from 9.1 to trunk, but accepts
it from 8.3 to 4.8 versions. 

$cat test.cc
template <class> class A {};
int main () { 
    typename :: template A <int> a;
}

$g++ test.cc
test.cc: In function ‘int main()’:
test.cc:3:26: error: ‘template’ must follow a nested-name-specifier
    3 |     typename :: template A <int> a;
      |                          ^~~~~~~
test.cc:3:26: error: expected ‘(’
    3 |     typename :: template A <int> a;
      |                          ^~~~~~~
      |                    

I also tested in clang, icc, and msvc, they all accept this code.

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

end of thread, other threads:[~2020-08-04 18:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-06 15:59 [Bug c++/96082] New: GCC rejects the template disambiguator with "typename" haoxintu at gmail dot com
2020-07-07  7:22 ` [Bug c++/96082] [9/10/11 Regression] " rguenth at gcc dot gnu.org
2020-07-07  8:52 ` marxin at gcc dot gnu.org
2020-08-03 23:59 ` mpolacek at gcc dot gnu.org
2020-08-04 17:41 ` cvs-commit at gcc dot gnu.org
2020-08-04 18:17 ` [Bug c++/96082] [9/10 " cvs-commit at gcc dot gnu.org
2020-08-04 18:24 ` [Bug c++/96082] [9 " 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).