This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/48118] New: g++ sometimes incorrectly allows copying a volatile trivially-copyable class


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: unassigned@gcc.gnu.org
        ReportedBy: jason@gcc.gnu.org


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);
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]