Syntactic clarification of 12-8-1 wording

Moderators: david ward, misra cpp

Post Reply
gs
Posts: 87
Joined: Thu Nov 18, 2004 1:39 am

Syntactic clarification of 12-8-1 wording

Post by gs » Thu Apr 24, 2014 5:06 pm

Rule 12-8-1 states:
A copy constructor shall only initialize its base classes and the non-static members of the class of which it is a member.
Does this sentence mean:
A copy constructor may only initialize and, when doing so, may only initialize its base classes and the non-static members of the class of which it is a member.
or
A copy constructor may do things other than initialization but, if it does initialize, it may only initialize its base classes and the non-static members of the class of which it is a member.
?

misra cpp
Posts: 151
Joined: Mon Jun 02, 2008 1:55 pm
Company: MISRA

Re: Syntactic clarification of 12-8-1 wording

Post by misra cpp » Tue Oct 11, 2016 11:04 am

The first alternative is intended
Posted by and on behalf of
the MISRA C++ Working Group

Post Reply

Return to “6.12 Special member functions (C++)”