mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-01 10:56:08 +00:00

trivial if the implicit declaration would be. Don't forget to set the Trivial flag on the special member as well as on the class. It doesn't seem ideal that we have two separate mechanisms for storing this information, but this patch does not attempt to address that. This leaves us in an interesting position where the has_trivial_X trait for a class says 'yes' for a deleted but trivial X, but is_trivially_Xable says 'no'. This seems to be what the standard requires. llvm-svn: 151465
15 lines
418 B
C++
15 lines
418 B
C++
// RUN: %clang_cc1 -std=c++11 -emit-llvm -o - %s | FileCheck %s
|
|
struct A { A(); };
|
|
template<typename T>
|
|
struct X : A // default constructor is not trivial
|
|
{
|
|
X() = default;
|
|
~X() {} // not a literal type
|
|
};
|
|
|
|
X<int> x;
|
|
// CHECK: define internal void @__cxx_global_var_init()
|
|
// CHECK: call {{.*}} @_ZN1XIiEC1Ev
|
|
// CHECK: define linkonce_odr {{.*}} @_ZN1XIiEC1Ev
|
|
// CHECK: define linkonce_odr {{.*}} @_ZN1XIiEC2Ev
|