1215e4e17d00e12c38687a95502506d8f2ca3e646Douglas Gregor// RUN: %clang_cc1 -std=c++11 %s -Wunused -verify 28e8fb3be5bd78f0564444eca02b404566a5f3b5dAndy Gibbs// expected-no-diagnostics 3215e4e17d00e12c38687a95502506d8f2ca3e646Douglas Gregor 4215e4e17d00e12c38687a95502506d8f2ca3e646Douglas Gregortemplate<typename T> 5215e4e17d00e12c38687a95502506d8f2ca3e646Douglas Gregorvoid destroy(T* ptr) { 6215e4e17d00e12c38687a95502506d8f2ca3e646Douglas Gregor ptr->~T(); 7215e4e17d00e12c38687a95502506d8f2ca3e646Douglas Gregor (*ptr).~T(); 8215e4e17d00e12c38687a95502506d8f2ca3e646Douglas Gregor} 9215e4e17d00e12c38687a95502506d8f2ca3e646Douglas Gregor 10215e4e17d00e12c38687a95502506d8f2ca3e646Douglas Gregorvoid destructor() { 11215e4e17d00e12c38687a95502506d8f2ca3e646Douglas Gregor auto lambda = []{}; 12215e4e17d00e12c38687a95502506d8f2ca3e646Douglas Gregor destroy(&lambda); 13215e4e17d00e12c38687a95502506d8f2ca3e646Douglas Gregor} 14