summaryrefslogtreecommitdiff
path: root/clang/test/CXX/expr/expr.unary/expr.new/p17-crash.cpp
blob: 27b915e95965d7e586c6ebce4111c568ca205064 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// RUN: %clang_cc1 -emit-llvm-only %s

// this used to crash due to templ<int>'s dtor not being marked as used by the
// new expression in func()
struct non_trivial {
  non_trivial() {} 
  ~non_trivial() {}
};
template < typename T > class templ {
  non_trivial n;
};
void func() {
  new templ<int>[1][1];
}