http://llvm.org/bugs/show_bug.cgi?id=20261
Bug ID: 20261
Summary: template argument deduction preformed on non-matching
overloads.
Product: clang
Version: unspecified
Hardware: PC
OS: Windows NT
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
Created attachment 12758
--> http://llvm.org/bugs/attachment.cgi?id=12758&action=edit
Reproducer
The following code does not compile with clang. It seems that even though the
second overload does not match the arguments template argument deduction is
performed on it causing bad_type to be instantiated.
I don't believe that is correct behavior.
This bug is currently playing havoc with std::tuples allocator_arg_t overloads.
> template <class T>
> struct never { enum { value = 0 }; };
>
> template <class T>
> struct bad_type
> {
> static_assert(never<T>::value, "Should not be instantiated");
> typedef bad_type type;
> };
>
> struct dummy_type {};
>
> struct test_t
> {
> // Overload #1
> test_t(int, int) {}
>
> // Overload #2
> template <class First, class = typename bad_type<First>::type>
> test_t(dummy_type, First) {}
> };
>
> int main() { test_t t(0, 0); }
--
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