-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clang requires template
keyword in places it should not (P0634, P1787)
#95447
Comments
@llvm/issue-subscribers-c-20 Author: Richard Smith (zygoloid)
Testcase:
```c++
template<typename T> void F() {
T::X<int> f();
}
template<typename T> class C { template<typename T>
|
@llvm/issue-subscribers-clang-frontend Author: Richard Smith (zygoloid)
Testcase:
```c++
template<typename T> void F() {
T::X<int> f();
}
template<typename T> class C { template<typename T>
|
Another case where Clang misses some of the P1787 changes for the handling of template<template<typename> typename> struct X {};
template<typename T> void f() {
X<T::R>(); // #1
X<typename T::R>(); // #2
X<T::template R>(); // #3
X<typename T::template R>(); // #4
}
struct D { template<typename> class R {}; };
void g() { f<D>(); } Under P1787: Unlike the previous case (which should be applied only in the language modes with implicit |
CC @Endilll |
One more place is in |
Also see: #81731 |
Testcase:
Under P1787 (DR against C++20), per [temp.names]/3, the
template
keyword is not required beforeX
ing
andh
, following the same rules that P0634 established for type-only contexts. But Clang (and GCC) seems to not implement this, and still requirestemplate
ing
andh
.The text was updated successfully, but these errors were encountered: