http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48118
Summary: g++ sometimes incorrectly allows copying a volatile
trivially-copyable class
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: [email protected]
ReportedBy: [email protected]
As noticed in PR 48113, we fail to give an error for the call to f below even
though it involves copying a volatile object and A doesn't have a copy
constructor that allows a volatile argument.
struct A { };
void f (A);
void (*g)(A);
int main()
{
volatile A a;
f(a);
g(a);
}