https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105752
Patrick Palka changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105752
--- Comment #5 from Csaba Ráduly ---
The fact that GCC 11 shows an error for the code in comment #4 suggests that
this was a bug which was fixed. Does it ring a bell to anyone? This bug should
probably marked as a duplicate, but of which other b
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105752
--- Comment #4 from Csaba Ráduly ---
Looks like there *was* a bug, I just wasn't able to properly reproduce it
initially:
#include
#include
class CB {
struct DCB {};
};
struct NMC1 : public CB {
int meow() const { return __LINE__
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105752
--- Comment #3 from Jonathan Wakely ---
And if you never instantiate the function, who cares? It doesn't actually
access the private member, because you never call it. And if you try to, it
doesn't compile.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105752
--- Comment #2 from Jonathan Wakely ---
Which is permitted by the standard.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105752
--- Comment #1 from Andrew Pinski ---
There might already been a dup of this. Gcc does not do access checking until
instantiation time (as you saw) even for non dependent things.