[Bug c++/52965] c++11 - subclass is private, but g++ ignores access modifier when using auto

2012-11-07 Thread jwcacces at yahoo dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52965



--- Comment #3 from James Caccese  2012-11-07 
18:40:44 UTC ---

On 11/7/2012 1:39 PM, paolo.carlini at oracle dot com wrote:

>

> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52965

>

> Paolo Carlini  changed:

>

> What|Removed |Added

> 

>   CC||daniel.kruegler at

> ||googlemail dot com

>

> --- Comment #2 from Paolo Carlini  
> 2012-11-07 18:39:09 UTC ---

> Can this be closed?

>



yes


[Bug c++/52965] New: c++11 - subclass is private, but g++ ignores access modifier when using auto

2012-04-12 Thread jwcacces at yahoo dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52965

 Bug #: 52965
   Summary: c++11 - subclass is private, but g++ ignores access
modifier when using auto
Classification: Unclassified
   Product: gcc
   Version: 4.6.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: jwcac...@yahoo.com


/*
   Is this a bug, that g++ ignores the private access modifier when using "auto
type deduction"?
   Compile with g++ -std=c++0x private_access.cpp
 vs g++ -std=c++0x private_access.cpp -DUSE_AUTO

   This seems similar to bug 52816
*/

class C
{
private:
   class PVT { };
public:
   PVT p() { return PVT(); };
};

int main(int, char*[])
{
   C c;
#ifdef USE_AUTO
   auto p = c.p();  // why does this work (in c++11)
#else
   C::PVT p = c.p();// but this reports that C::PVT is private?
#endif
   return 0;
};