Commit 401219a6 by Jason Merrill

* decl2.c (get_guard): Check DECL_FUNCTION_SCOPE_P.

From-SVN: r36567
parent 99fada40
// Bug: g++ was failing to destroy C<int>::a because it was using two
// different sentry variables for construction and destruction.
extern "C" void _exit (int);
int r = 1;
struct A
{
void f(){};
A(){ ++r; }
~A(){ r -= 2; _exit (r); }
};
template<class T>
struct C
{
C(){ a.f(); }
static A a;
};
template <class T> A C<T>::a;
typedef C<int> B;
int main()
{
C<int> c;
return r;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment