[llvm-bugs] [Bug 41381] New: Cannot find base's conversion operator to templatized type when operator is explicitly called.
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Apr 4 09:26:33 PDT 2019
https://bugs.llvm.org/show_bug.cgi?id=41381
Bug ID: 41381
Summary: Cannot find base's conversion operator to templatized
type when operator is explicitly called.
Product: clang
Version: 8.0
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: cassio.neri at gmail.com
CC: blitzrakete at gmail.com, dgregor at apple.com,
erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
richard-llvm at metafoo.co.uk
Consider:
template <typename>
struct foo {};
struct base {
operator int() { return 0; }
template <typename T>
operator foo<T>() { return foo<T>(); }
};
struct derived : base {};
int main() {
derived d;
(void) d.operator foo<int>(); // Error
(void) static_cast<foo<int> >(d); // OK
(void) d.operator int(); // OK
base b;
(void) b.operator foo<int>(); // OK
}
The error is:
error: no member named 'operator foo' in 'derived'
(void) d.operator foo<int>(); // Error
~ ^
Remarks:
1) fails for all versions of clang available at godbolt.org
2) fails on clang 8.0 for all -std=c++{98,11,14,17}
3) works with other compilers.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190404/5263502d/attachment.html>
More information about the llvm-bugs
mailing list