Index: clang/lib/CodeGen/CodeGenModule.cpp =================================================================== --- clang/lib/CodeGen/CodeGenModule.cpp +++ clang/lib/CodeGen/CodeGenModule.cpp @@ -4320,7 +4320,8 @@ if (const CXXRecordDecl *Record = Context.getBaseElementType(Ty)->getAsCXXRecordDecl()) return ExcludeCtor && !Record->hasMutableFields() && - Record->hasTrivialDestructor(); + (Record->hasTrivialDestructor() || + Record->hasConstexprDestructor()); } return true; Index: clang/test/CodeGenCXX/const-init-cxx2a.cpp =================================================================== --- clang/test/CodeGenCXX/const-init-cxx2a.cpp +++ clang/test/CodeGenCXX/const-init-cxx2a.cpp @@ -11,10 +11,10 @@ constexpr ~B() { n *= 5; } int n = 123; }; -// CHECK: @b ={{.*}} global {{.*}} i32 123 +// CHECK: @b ={{.*}} constant {{.*}} i32 123 extern constexpr B b = B(); -// CHECK: @_ZL1c = internal global {{.*}} i32 123 +// CHECK: @_ZL1c = internal constant {{.*}} i32 123 const B c; int use_c() { return c.n; }