https://bugs.llvm.org/show_bug.cgi?id=50170
Bug ID: 50170
Summary: clang fails to compile call to instance of
function-typed variable template
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: C++17
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected]
clang version 9 to 12 fail to compile the following code:
```
template <typename T, bool A>
void funcTemplate() {}
template <typename T>
struct Traits {
template <bool A>
static inline constexpr auto func =
funcTemplate<T, A>;
};
template<typename T>
void use() {
const auto func = Traits<T>::template func<false>;
func();
}
int main() {
use<int>();
}
```
with the following diagnostics:
```
<source>:15:3: error: called object type 'auto' is not a function or function
pointer
func();
^~~~
<source>:19:5: note: in instantiation of function template specialization
'use<int>' requested here
use<int>();
```
clang 8 and recent gcc versions compile this correctly.
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs