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

             Bug #: 14558
           Summary: std::is_trivial broken for nested structs
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++11
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified


clang trunk r169725. I have a struct with an explicitly-defaulted default
constructor. std::is_trivial gives a false negative when the struct is declared
inside another struct:

#include <type_traits>

struct A {
  A() = default;
};

struct B {
  A foo;
};

static_assert(std::is_trivial<A>::value, "A is not trivial");
static_assert(std::is_trivial<B>::value, "B is not trivial");

struct C {
  struct D {
    D() = default;
  };

  D foo;
};

static_assert(std::is_trivial<C::D>::value, "C::D is not trivial");
static_assert(std::is_trivial<C>::value, "C is not trivial");


Only the last static_assert fails, the other three are ok. I expect that the
"struct C" is also "trivial".

This is a recent regression, it worked last week.

-- 
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