http://llvm.org/bugs/show_bug.cgi?id=22247
Bug ID: 22247
Summary: use 'template' keyword to treat 'get' as a dependent
template name [fails if get<>() is called via array:
a[0].get<>(), otherwise works: b.get<>()]
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
Reduced and discussed testcase at #llvm
class foo {
public:
template<typename T> T get() const;
};
template <class T>
class bar {
private:
foo x;
foo y[1];
public:
bar() {
x.get<int>(); // ok
y[0].get<int>(); // error?!
}
};
prog.cc:15:10: error: use 'template' keyword to treat 'get' as a dependent
template name y[0].get<int>(); // error?! ^ template 1 error generated.
get<>() is not dependent on template parameters. The compiler treats get<>()
unfairly if it's called via array, otherwise works just fine.
I assume some internal check if Clang does not catch/match all options.
C++ 14.2/4 only lists examples where a method call is directly dependent on
template parameters. In that case using "template" keyword is required. In this
testcase get<>() is not dependent on class template parameters.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs