Bug 45975 - template keyword is not allowed, however, accepted by g++
Summary: template keyword is not allowed, however, accepted by g++
Status: RESOLVED DUPLICATE of bug 55588
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.5.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
 
Reported: 2010-10-12 06:47 UTC by Michael Schulze
Modified: 2021-08-23 08:12 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 4.5.4, 4.8.3, 4.9.3, 5.3.0, 6.2.0, 7.1.0, 8.0
Last reconfirmed: 2010-10-12 08:20:14


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Schulze 2010-10-12 06:47:12 UTC
Look at the following code snippet

template<int a>
struct A {
    static const int value;
};

template<int a>
const int A< a>::template value = 0; 
                 ^^^^^^^^

This template keyword is not allowed, because value is not template by itself but g++ accept this code without any complaints.
Comment 1 Martin Sebor 2017-11-27 20:02:40 UTC
The invalid code is still accepted by GCC 8.0/
Comment 2 Andrew Pinski 2021-08-23 08:12:33 UTC
Dup of bug 55588.

*** This bug has been marked as a duplicate of bug 55588 ***