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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to