Re: [C++ RFC / Patch] PR 51213 (access control under SFINAE)

2012-07-19 Thread Paolo Carlini
On 07/19/2012 03:35 AM, Jason Merrill wrote: On 07/12/2012 07:06 PM, Jason Merrill wrote: I notice that your patch changes the behavior of C++98/03 mode as well, which seems wrong to me; I think this is a big enough change that we should limit it to C++11 mode. ...except that I can't figure

Re: [C++ RFC / Patch] PR 51213 (access control under SFINAE)

2012-07-18 Thread Jason Merrill
On 07/12/2012 07:06 PM, Jason Merrill wrote: I notice that your patch changes the behavior of C++98/03 mode as well, which seems wrong to me; I think this is a big enough change that we should limit it to C++11 mode. ...except that I can't figure out what the semantics before this DR were

Re: [C++ RFC / Patch] PR 51213 (access control under SFINAE)

2012-07-17 Thread Paolo Carlini
Hi, On 07/16/2012 07:39 PM, Jason Merrill wrote: On 07/14/2012 05:54 AM, Paolo Carlini wrote: The above change of yours appear to imply that, at variance with what I had in my first draft, perform_typedefs_access_check shouldn't really gain a tsubst_flags_t argument, because now it's called by

Re: [C++ RFC / Patch] PR 51213 (access control under SFINAE)

2012-07-17 Thread Paolo Carlini
Hi, On 07/17/2012 04:10 PM, Jason Merrill wrote: On 07/17/2012 08:45 AM, Paolo Carlini wrote: -check_default_argument (tree decl, tree arg) +check_default_argument (tree decl, tree arg, tsubst_flags_t complain) Hmm, I don't think substitution of default arguments can cause deduction

Re: [C++ RFC / Patch] PR 51213 (access control under SFINAE)

2012-07-17 Thread Paolo Carlini
Hi again, Hmm, now that I look at the code in instantiate_decl for re-substituting to get additional errors, I guess I should have factored that code out into a separate function and used it in the access7 patch rather than add handling of FNDECL_RECHECK_ACCESS_P in tsubst_decl. I see. Could

Re: [C++ RFC / Patch] PR 51213 (access control under SFINAE)

2012-07-17 Thread Jason Merrill
On 07/17/2012 09:20 PM, Paolo Carlini wrote: The below variant adds a fndecl_recheck_access_p and uses it in two places, in tsubst_decl and instantiate_template_1. Did I understand correctly? I had something else in mind, but I'll take care of it. Jason

Re: [C++ RFC / Patch] PR 51213 (access control under SFINAE)

2012-07-16 Thread Jason Merrill
On 07/14/2012 05:54 AM, Paolo Carlini wrote: The above change of yours appear to imply that, at variance with what I had in my first draft, perform_typedefs_access_check shouldn't really gain a tsubst_flags_t argument, because now it's called by instantiate_decl and instantiate_class_template_1

Re: [C++ RFC / Patch] PR 51213 (access control under SFINAE)

2012-07-14 Thread Paolo Carlini
Hi, and, first, thanks a lot for all the nice work and help on these issues! On 07/13/2012 12:55 AM, Jason Merrill wrote: diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index fec88eb..95c6464 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -8334,7 +8334,7 @@ apply_late_template_attributes (tree *decl_p,

Re: [C++ RFC / Patch] PR 51213 (access control under SFINAE)

2012-07-12 Thread Jason Merrill
On 06/15/2012 04:27 PM, Paolo Carlini wrote: FAIL: g++.dg/template/access7.C -std=c++98 (test for errors, line 8) FAIL: g++.dg/template/access7.C -std=c++98 (test for errors, line 12) FAIL: g++.dg/template/access7.C -std=c++98 (test for warnings, line 17) FAIL: g++.dg/template/access7.C

Re: [C++ RFC / Patch] PR 51213 (access control under SFINAE)

2012-07-12 Thread Jason Merrill
And here's a fix for the access7 failure, to be applied on top of your patch. I notice that your patch changes the behavior of C++98/03 mode as well, which seems wrong to me; I think this is a big enough change that we should limit it to C++11 mode. Jason commit

Re: [C++ RFC / Patch] PR 51213 (access control under SFINAE)

2012-07-12 Thread Jason Merrill
These patches fix the typedef11.C and friend13/15.C failures. Each fixes a latent bug in the compiler. 1) We shouldn't do access control checking for typedefs used in the body of a function when the declaration is instantiated; we should wait until the body is instantiated. 2) We shouldn't

Re: [C++ RFC / Patch] PR 51213 (access control under SFINAE)

2012-07-09 Thread Jason Merrill
On 07/02/2012 09:47 PM, Jason Merrill wrote: FAIL: g++.dg/template/friend13.C -std=c++11 (test for excess errors) OK, the problem here is that we need to look up Outer::Inner in order to generate the declaration of fooOuter, and we can't check whether fooOuter is a friend of Outer until

Re: [C++ RFC / Patch] PR 51213 (access control under SFINAE)

2012-07-02 Thread Jason Merrill
On 06/15/2012 10:27 AM, Paolo Carlini wrote: The problem is that with the patch applied we get errors of the no matching function type, instead of access control errors. I suppose this is expected, right?!? Yes, but when we're printing the candidates we need to give an access control error

Re: [C++ RFC / Patch] PR 51213 (access control under SFINAE)

2012-06-28 Thread Paolo Carlini
On 06/15/2012 04:27 PM, Paolo Carlini wrote: Hi, as I mentioned a few days ago, I'm working on implementing this feature, which I personally consider rather high priority, from the library point of view too (eg, type_traits). I have been making some progress - I'm attaching below what I have