Bug 89978 - Extraneous template keyword not rejected
Summary: Extraneous template keyword not rejected
Status: RESOLVED DUPLICATE of bug 55588
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 8.3.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
 
Reported: 2019-04-04 20:47 UTC by Vincent
Modified: 2021-08-23 08:12 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vincent 2019-04-04 20:47:58 UTC
The compiler does not reject the following:

struct A{
  void f(){}
};

struct B{
  static A& n(){
    return *new A();
  }
};

template <typename T>
struct C{
  void g(){
    T::n().template f();
  }
};

int main(){
  (new C<B>())->g();
}

Function A::f is not template.
Comment 1 Andrew Pinski 2021-08-23 08:12:04 UTC
Dup of bug 55588.

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