[LLVMbugs] [Bug 23764] New: Clang and GCC disagree about triviality of type with defaulted non-const copy constructor (breaks ABI!)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jun 4 17:38:27 PDT 2015


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

            Bug ID: 23764
           Summary: Clang and GCC disagree about triviality of type with
                    defaulted non-const copy constructor (breaks ABI!)
           Product: clang
           Version: 3.6
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: kenton at sandstorm.io
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The program below outputs 0 when compiled with Clang and 1 when compiled with
G++.

Unfortunately, this disagreement means that Clang and G++ implement different
argument-passing conventions for functions which take an argument with such a
type, and therefore libraries which use such types in their API (like Cap'n
Proto) cannot be used unless the library and caller are built with the same
compiler.

#include <iostream>

class C {
public:
  C(C&) = default;
};

int main() {
  std::cout << __has_trivial_copy(C) << std::endl;
  return 0;
}

-- 
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/20150605/c3407026/attachment.html>


More information about the llvm-bugs mailing list