[llvm-bugs] [Bug 30759] New: incorrect behavior with std::is_same with nested class in a template class

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Oct 21 05:05:36 PDT 2016


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

            Bug ID: 30759
           Summary: incorrect behavior with std::is_same with nested class
                    in a template class
           Product: libc++
           Version: 3.9
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jeanmichael.celerier at gmail.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com
    Classification: Unclassified

In this code, the first static_assert compiles with clang++ (and also g++, but
not MSVC) : 

    #include <type_traits>
    template<typename T>
    struct foo
    {
        using sub = struct some_struct;
    };

    template<typename T>
    struct bar
    {
        using sub = struct some_struct { };
    };

    int main()
    {
        static_assert(std::is_same<foo<int>::sub, foo<double>::sub>::value,
"should not pass");
        static_assert(std::is_same<bar<int>::sub, bar<double>::sub>::value,
"should not pass");
    }

The second does (correctly, in my opinion) not.

Here is the relevant bug report in the gcc bug tracker if it can be useful :
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78065

-- 
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/20161021/0b6c1353/attachment.html>


More information about the llvm-bugs mailing list