xref: /aosp_15_r20/external/clang/test/CXX/expr/expr.unary/expr.new/p17-crash.cpp (revision 67e74705e28f6214e480b399dd47ea732279e315)
1 // RUN: %clang_cc1 -emit-llvm-only %s
2 
3 // this used to crash due to templ<int>'s dtor not being marked as used by the
4 // new expression in func()
5 struct non_trivial {
non_trivialnon_trivial6   non_trivial() {}
~non_trivialnon_trivial7   ~non_trivial() {}
8 };
9 template < typename T > class templ {
10   non_trivial n;
11 };
func()12 void func() {
13   new templ<int>[1][1];
14 }
15