if (!VDecl->isInvalidDecl() &&
!VDecl->getDeclContext()->isDependentContext() &&
- VDecl->hasGlobalStorage() &&
+ VDecl->hasGlobalStorage() && !VDecl->isStaticLocal() &&
!VDecl->getInit()->isConstantInitializer(Context,
VDecl->getType()->isReferenceType()))
Diag(VDecl->getLocation(), diag::warn_global_constructor)
void f2() {
static A& a = *new A;
}
+}
+
+namespace pr8095 {
+ struct Foo {
+ int x;
+ Foo(int x1) : x(x1) {}
+ };
-}
\ No newline at end of file
+ void bar() {
+ static Foo a(0);
+ }
+}