[Bug c++/66847] Derived class calling protected base ctor using C++11 {brace} init = spurious access denied error

2018-02-19 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66847

Jonathan Wakely  changed:

   What|Removed |Added

 CC||tolez_xuninada at hotmail dot 
com

--- Comment #10 from Jonathan Wakely  ---
*** Bug 84451 has been marked as a duplicate of this bug. ***

[Bug c++/66847] Derived class calling protected base ctor using C++11 {brace} init = spurious access denied error

2016-07-25 Thread db0451 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66847

--- Comment #9 from DB  ---
Will the fix hit any previous major versions, esp. 6?

[Bug c++/66847] Derived class calling protected base ctor using C++11 {brace} init = spurious access denied error

2016-07-25 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66847

Jason Merrill  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |7.0

--- Comment #8 from Jason Merrill  ---
Fixed for GCC 7.

[Bug c++/66847] Derived class calling protected base ctor using C++11 {brace} init = spurious access denied error

2016-07-22 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66847

Jason Merrill  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||jason at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |jason at gcc dot gnu.org

[Bug c++/66847] Derived class calling protected base ctor using C++11 {brace} init = spurious access denied error

2016-07-22 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66847

--- Comment #7 from Jason Merrill  ---
*** Bug 66617 has been marked as a duplicate of this bug. ***

[Bug c++/66847] Derived class calling protected base ctor using C++11 {brace} init = spurious access denied error

2015-07-22 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66847

Jonathan Wakely  changed:

   What|Removed |Added

 Target|=x86_64-w64-mingw32 |
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-07-22
   Host|=x86_64-w64-mingw32 |
 Ever confirmed|0   |1
  Known to fail||5.1.1, 6.0
  Build|4.9.2   |

--- Comment #6 from Jonathan Wakely  ---
This seems different enough to PR 63151 and PR 66617 to warrant it's own PR.


Reduced:

struct VBase { };

class Base
: public virtual VBase
{
protected:
Base(int, int)
{}
};

struct Derived : Base
{
Derived()
:
Base{1, 1}
{}
};

Derived myDerived;



x.cc: In constructor ‘Derived::Derived()’:
x.cc:15:12: error: ‘Base::Base(int, int)’ is protected within this context
   Base{1, 1}
^
x.cc:7:2: note: declared protected here
  Base(int, int)
  ^

[Bug c++/66847] Derived class calling protected base ctor using C++11 {brace} init = spurious access denied error

2015-07-12 Thread db0451 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66847

--- Comment #5 from DB  ---
Another note is that, as per the other tickets, G++ seems to have multiple
possible causes of its confusion with brace-init:
* presence of virtual base in class hierarchy
* signature of calling class ctor vs base ctor
* presence/absence of member variables
* possible more...?

Hopefully it points at a single cause that can be fixed fairly easily. As
currently we have to selectively regress certain parts of our source, to work
around G++, and add large comments explaining the inconsistency, which is far
from ideal. It's also conceivable that certain situations couldn't be worked
around by replacing the bracket type, though thankfully we've not had that yet.

Cheers,
D.


[Bug c++/66847] Derived class calling protected base ctor using C++11 {brace} init = spurious access denied error

2015-07-12 Thread db0451 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66847

--- Comment #4 from DB  ---
It should be noted that although I have a commented-out {brace} ctor for the
final class in main(), that was just a test; both {brace} and (parenthesis)
init in that context produce the same behaviour. That is: dependent upon the
type of braces used by Derived to call Base ctor.


[Bug c++/66847] Derived class calling protected base ctor using C++11 {brace} init = spurious access denied error

2015-07-12 Thread db0451 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66847

--- Comment #3 from DB  ---
Created attachment 35956
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35956&action=edit
-save-temps output .ii file


[Bug c++/66847] Derived class calling protected base ctor using C++11 {brace} init = spurious access denied error

2015-07-12 Thread db0451 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66847

--- Comment #2 from DB  ---
Created attachment 35955
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35955&action=edit
command line output after adding -v and -save-temps


[Bug c++/66847] Derived class calling protected base ctor using C++11 {brace} init = spurious access denied error

2015-07-12 Thread db0451 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66847

DB  changed:

   What|Removed |Added

 CC||db0451 at gmail dot com

--- Comment #1 from DB  ---
Created attachment 35954
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35954&action=edit
compiler command line output when compiled with recommended safeguards