blob: 792c25369c740b765d5ef9b0f95df6c239b534b6 [file] [log] [blame]
// PR c++/38958
// { dg-options "-Wunused" }
volatile int g;
struct Lock
{
~Lock() { g = 0; }
};
Lock AcquireLock() { return Lock(); }
int main()
{
const Lock& lock = AcquireLock();
g = 1;
g = 2;
g = 3;
}