http://bugs.llvm.org/show_bug.cgi?id=32179

            Bug ID: 32179
           Summary: SFINAE emits a substitution error even though it
                    shouldn't when checking an overload
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]

Created attachment 18065
  --> http://bugs.llvm.org/attachment.cgi?id=18065&action=edit
The test file that reproduces the problem

Clang trunk emits a substitution error when checking if a particular overload
of 'invoke' can be selected:

test.cpp:135:50: error: type 'decay_t<double>' (aka 'double') cannot be used
prior to '::' because it has no members
  using functor_type = function_traits<decltype(&decay_t<F>::operator())>;
                                                 ^
test.cpp:184:25: note: in instantiation of template class
'function_traits<double>' requested here
    make_index_sequence<function_traits<Functor>::arity> { }))>
                        ^
test.cpp:224:29: note: while substituting deduced template arguments into
function template 'invoke' [with Functor = double, Runpackable = double]
  constexpr double result = invoke(test { }, 0.5, 2.5);


Even though we get this SFINAE error, Clang still selects the correct version
of 'invoke' (verified by AST inspection and static assert check).

GCC compiles the test file successfully.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to