[llvm-bugs] [Bug 25661] New: Clang frontend doesn't deal with class member function pointer passed as template argument correctly on Windows

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Nov 27 12:18:31 PST 2015


https://llvm.org/bugs/show_bug.cgi?id=25661

            Bug ID: 25661
           Summary: Clang frontend doesn't deal with class member function
                    pointer passed as template argument correctly on
                    Windows
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: wanyingloo at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

This seems a regression of Windows targets in Clang 3.5 and it's reproducible
in the trunk.

$ cat test.cpp
template<typename T>
struct is_function
{
    static constexpr bool value = false;
};
template<typename _Res, typename... _ArgTypes>
struct is_function<_Res(_ArgTypes...)>
{
    static constexpr bool value = true;
};

template<typename>
struct helper {};
template<typename _Tp, typename _Cp>
struct helper<_Tp _Cp::*> : public is_function<_Tp> {};

class class_type {};
static_assert(
    helper<void(class_type::*)()>::value
  , "void(class_type::*)() IS a member function pointer");


$ clang-3.4/bin/clang -c -std=c++11 -target x86_64-unknown-linux-gnu test.cpp
$ clang-3.4/bin/clang -c -std=c++11 -target i686-pc-mingw32 test.cpp

$ clang-3.5/bin/clang -c -std=c++11 -target x86_64-unknown-linux-gnu test.cpp
$ clang-3.5/bin/clang -c -std=c++11 -target i686-pc-mingw32 test.cpp
test.cpp:19:1: error: static_assert failed "void(class_type::*)() IS a member
function pointer"
static_assert(
^
1 error generated.

-- 
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/20151127/e32cec75/attachment.html>


More information about the llvm-bugs mailing list