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

             Bug #: 11387
           Summary: template classes are never "trivial" in C++0x
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++0x
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified


clang trunk r144645, libstdc++ 4.6.2.

A template class with an explicitly defaulted constructor is never "trivial"
according to std::is_trivial, even if the template argument is never used.

template<typename T> struct OK {};
template<typename T> struct Foo { Foo() = default; };
struct Bar { Foo<int> foo; };
#include <type_traits>
static_assert(std::is_trivial<OK<int>>::value, "OK");
static_assert(std::is_trivial<Foo<int>>::value, "Foo");
static_assert(std::is_trivial<Bar>::value, "Bar");

This succeeds for class "OK", because it does not have an explicit constructor.
Class "Foo" fails when it has a defaulted constructor, and so class "Bar" also
fails.

Related: Bug 11295, Bug 10442.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- 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

Reply via email to