| Douglas Gregor | 1a22d28 | 2012-02-12 17:34:23 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -std=c++11 %s -Wunused -verify |
| Andy Gibbs | c6e68da | 2012-10-19 12:44:48 +0000 | [diff] [blame] | 2 | // expected-no-diagnostics |
| Douglas Gregor | 1a22d28 | 2012-02-12 17:34:23 +0000 | [diff] [blame] | 3 | |
| 4 | template<typename T> | ||||
| 5 | void destroy(T* ptr) { | ||||
| 6 | ptr->~T(); | ||||
| 7 | (*ptr).~T(); | ||||
| 8 | } | ||||
| 9 | |||||
| 10 | void destructor() { | ||||
| 11 | auto lambda = []{}; | ||||
| 12 | destroy(&lambda); | ||||
| 13 | } | ||||