[llvm-bugs] [Bug 50561] New: Concepts overload check not considered?
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Jun 2 06:03:36 PDT 2021
https://bugs.llvm.org/show_bug.cgi?id=50561
Bug ID: 50561
Summary: Concepts overload check not considered?
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: C++2a
Assignee: unassignedclangbugs at nondot.org
Reporter: erich.keane at intel.com
CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk
I'm not sure whose bug this is, my concepts aren't particularly great yet,
but...
https://godbolt.org/z/acK51xve3
template <typename a>
concept bd = a::c;
template <typename, typename as, typename... be>
void bf(as, be...);
template <bd a, typename as>
void bf(as) {
using bg = typename a::second_type;
}
template <typename, typename> class vector {
static constexpr bool c = false; // #1
};
void b() {
bf<vector<int, int>>(0);
}
GCC selects the 1st overload of 'bf', clang chooses the 2nd overload. Neither
compiler seems to consider the line on #1. It can be 'true' 'false' or not
existent.
It seems to me that the concept 'bd' should NOT match vector if 'c' is false or
non-existent, so I would expect it to choose the 1st overload.
--
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/20210602/f47fc290/attachment.html>
More information about the llvm-bugs
mailing list