[llvm-bugs] [Bug 32179] New: SFINAE emits a substitution error even though it shouldn't when checking an overload

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Mar 8 02:52:07 PST 2017


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: unassignedclangbugs at nondot.org
          Reporter: arphaman at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170308/09d5ecb6/attachment.html>


More information about the llvm-bugs mailing list