15 lines · cpp
1// RUN: %clang_cc1 -emit-llvm-only %s2 3// this used to crash due to templ<int>'s dtor not being marked as used by the4// new expression in func()5struct non_trivial {6 non_trivial() {} 7 ~non_trivial() {}8};9template < typename T > class templ {10 non_trivial n;11};12void func() {13 new templ<int>[1][1];14}15