[LLVMbugs] [Bug 14122] New: a union member with a non-trivial constructor due to an in-class initializer crashes clang

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Oct 18 13:18:28 PDT 2012


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

             Bug #: 14122
           Summary: a union member with a non-trivial constructor due to
                    an in-class initializer crashes clang
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++11
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: seth.cantrell at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


The following code causes clang trunk to crash

// clang++ -std=c++11 test.cpp
struct S {
    int i = 1;
};

union U {
    S s;
} u;

with the output:

found no explanation for non-trivial member
UNREACHABLE executed at [...]\llvm\tools\clang\lib\Sema\SemaDecl.cpp:9827!

The issue is that Sema::DiagnoseNontrivial doesn't yet handle C++11 in-class
initializers. (it also doesn't handle other C++11 things, such as that user
declared constructors can still be trivial...)

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