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++/51213] [C++11][DR 1170] Access control checking has to be done under SFINAE conditions


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

Daniel KrÃgler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |

--- Comment #8 from Daniel KrÃgler <daniel.kruegler at googlemail dot com> 2012-07-23 21:01:09 UTC ---
I agree that the actual test examples work now, but I also found that only
*slight* variations of the call context of the test expression
"sizeof(f<C>(0))" again lead to access errors. The following variants
demonstrate this:

//---
class C {
  typedef int type; // Line 2
};

template<class T, class = typename T::type>
auto f(int) -> char;

template<class>
auto f(...) -> char (&)[2];

static_assert(sizeof(f<C>(0)) == 2, ""); // OK

typedef int test[sizeof(f<C>(0)) == 2 ? 1 : -1]; // Error

template<int>
struct I {};

I<sizeof(f<C>(0))> i; // Error

enum E { e1 = sizeof(f<C>(0)) }; // Error
//---

"13|error: size of array 'test' is negative|
2|error: 'typedef int C::type' is private|
5|error: within this context|
2|error: 'typedef int C::type' is private|
18|error: within this context|
2|error: 'typedef int C::type' is private|
5|error: within this context|
"

Jason suggested to reopen the issue, so I did.


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