[LLVMbugs] [Bug 14558] New: std::is_trivial broken for nested structs

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Dec 10 02:39:56 PST 2012


             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: unassignedclangbugs at nondot.org
        ReportedBy: max at duempel.org
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    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.

More information about the llvm-bugs mailing list