Fixes PR19253.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204825
91177308-0d34-0410-b5e6-
96231b3b80d8
Diag(VD->getLocation(), diag::warn_exit_time_destructor);
// TODO: this should be re-enabled for static locals by !CXAAtExit
- if (!VD->isStaticLocal())
+ if (!Destructor->isTrivial() && !VD->isStaticLocal())
Diag(VD->getLocation(), diag::warn_global_destructor);
}
-// RUN: %clang_cc1 -fsyntax-only -Wglobal-constructors %s -verify
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -Wglobal-constructors %s -verify
int opaque_int();
int a;
A b = { a };
}
+
+namespace pr19253 {
+ struct A { ~A() = default; };
+ A a;
+ struct B { ~B() {} };
+ struct C : B { ~C() = default; };
+ C c; // expected-warning {{global destructor}}
+}