This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51213] [C++11][DR 1170] Access control checking has to be done under SFINAE conditions
- From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 23 Jul 2012 21:01:09 +0000
- Subject: [Bug c++/51213] [C++11][DR 1170] Access control checking has to be done under SFINAE conditions
- Auto-submitted: auto-generated
- References: <bug-51213-4@http.gcc.gnu.org/bugzilla/>
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.