Re: [PATCH] c++: error message for dependent template members [PR70417]

2022-01-15 Thread Anthony Sharp via Gcc-patches
Hi Jason, Hope you are well. Apologies, I've not had time to sit down and look at this since last month I quit my old job, then I had family around for the whole of the Christmas period, and then even more recently I've had to start my new job. In any case happy that you managed to figure it all

Re: [PATCH] c++: error message for dependent template members [PR70417]

2021-12-04 Thread Anthony Sharp via Gcc-patches
Hi Jason, Hope you are well. Apologies for not coming back sooner. >I'd put it just above the definition of saved_token_sentinel in parser.c. Sounds good, done. >Maybe cp_parser_require_end_of_template_parameter_list? Either way is fine. Even better, have changed it. >Hmm, good point; operat

Re: [PATCH] c++: error message for dependent template members [PR70417]

2021-10-10 Thread Anthony Sharp via Gcc-patches
Hi Jason, Hope you are well. Thanks for the feedback. > I like adding the configurability, but I think let's keep committing as > the default behavior. And adding the parameter to the rollback function > seems unnecessary. For the behavior argument, let's use an enum to be > clearer. > Sure,

Re: [PATCH] c++: error message for dependent template members [PR70417]

2021-09-17 Thread Anthony Sharp via Gcc-patches
> next_token->location), > parser->scope)) > > This meant a lot of things were being excluded that weren't supposed > to be. Oops! Changing this opened up a whole new can of worms, so I > had t

Re: [PATCH] c++: error message for dependent template members [PR70417]

2021-09-17 Thread Anthony Sharp via Gcc-patches
o make some changes to the main logic, but it just a little bit in the end. Regtested everything again and all seems fine. Bootstraps fine. Patch attached. Let me know if it needs anything else. Thanks for the help, Anthony On Fri, 27 Aug 2021 at 22:33, Jason Merrill wrote: > > On 8/20/21

[PATCH] c++: error message for dependent template members [PR70417]

2021-08-20 Thread Anthony Sharp via Gcc-patches
Hi, hope everyone is well. I have a patch here for issue 70417 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70417). I'm still a GCC noob, and this is probably the hardest thing I have ever coded in my life, so please forgive any initial mistakes! TLDR This patch introduces a helpful error messag

Re: [PATCH] c++: Private parent access check for using decls [PR19377]

2021-03-10 Thread Anthony Sharp via Gcc-patches
Hiya > That's because none of the names are overloaded within a single base > class. Ah, thanks. Thought there must be something I wasn't thinking of. > Also, you can use == instead of cp_tree_equal for comparing FUNCTION_DECLs. Changed it. Latest patch is attached. Compiles fine and no regres

Re: [PATCH] c++: Private parent access check for using decls [PR19377]

2021-03-01 Thread Anthony Sharp via Gcc-patches
Hi all, Here is the patch as promised. Regression tested on the c++ side and everything seems okay. Compiles fine. Sounds good, though strip_using_decl (parent_field) may be overloaded if > the using-decl brings in multiple functions with that name. Could you give my new regression test a quick

Re: [PATCH] c++: Private parent access check for using decls [PR19377]

2021-02-24 Thread Anthony Sharp via Gcc-patches
> "special" It wouldn't be my code if it didn't have sp3ling mstakes innit! Actually to be fair I already changed that spelling mistake a few days ago in my local code ;) I was actually thinking about this last night as I was falling asleep (as you do) and I realised that the whole of my using d

Re: [PATCH] c++: Private parent access check for using decls [PR19377]

2021-02-15 Thread Anthony Sharp via Gcc-patches
Scan the fields of BINFO for an exact match of DECL. If found, return DECL. Otherwise, return NULL_TREE. DECL is really the type "tree". */ Should say Scan the fields of BINFO for an exact match of DECL. If found, return the field. Otherwise, return NULL_TREE. DECL is really the type

Re: [PATCH] c++: Private parent access check for using decls [PR19377]

2021-02-15 Thread Anthony Sharp via Gcc-patches
Hi all, This overloaded functions issue has been a pain in the ass but I have found a solution that seems to work. I could really do with some feedback on it though since I'm not sure if there's a better way to do it that I am missing. Here's the problem. When a using statement causes an access f

Re: [PATCH] c++: Private parent access check for using decls [PR19377]

2021-02-09 Thread Anthony Sharp via Gcc-patches
> > The parens are to help the editor line up the last line properly. If > the subexpression fits on one line, the parens aren't needed. A okay. No; "compile" means translate from C++ to assembly, "assemble" means > that, plus call the assembler to produce an object file. Though since > co

Re: [PATCH] c++: Private parent access check for using decls [PR19377]

2021-02-06 Thread Anthony Sharp via Gcc-patches
en I donno, because Linux Text Editor says both are on column 64. >> > >> > To be honest, I'm sure there is a way to do it, but I'm not really >> > sure how to consistently align code. Every text/code editor/browser >> > seems to give different column numbers (an

Re: [PATCH] c++: Private parent access check for using decls [PR19377]

2021-02-06 Thread Anthony Sharp via Gcc-patches
column numbers (and display it differently) > > since they seem to all treat whitespace differently. > > Yeah, that can be a pain. Best if your editor does it for you. If you > use vim, you can use gcc/contrib/vimrc and then vim will do most of the > formatting for you. >

Re: [PATCH] c++: Private parent access check for using decls [PR19377]

2021-02-05 Thread Anthony Sharp via Gcc-patches
t to replace both with > // { dg-do compile { target c++17 } } Okie dokie. I did see both being used and I wasn't sure which to go for. I'll probably send another patch over tomorrow. Anthony On Fri, 5 Feb 2021 at 16:06, Marek Polacek wrote: > > Hi, > >

Re: [PATCH] c++: Private parent access check for using decls [PR19377]

2021-02-05 Thread Anthony Sharp via Gcc-patches
nd like a better way of doing it. Would I just do > > > cp_tree_equal (DECL_NAME (blah1), DECL_NAME (blah2)) [assuming > > > DECL_NAME returns a tree], or perhaps DECL_NAME (blah1) == DECL_NAME > > > (blah2)? > > > > == is enough, identifiers are unique. > >

Re: [PATCH] c++: Private parent access check for using decls [PR19377]

2021-02-05 Thread Anthony Sharp via Gcc-patches
gt; > DECL. If we find a using statement introducing DECL in PARENT_BINFO, > > then surely the using statement must (by definition) have been > > private? If it were not private, then the child class would have been > > able to access it, and enforce_access wouldn't have thr

Re: [PATCH] c++: Private parent access check for using decls [PR19377]

2021-02-04 Thread Anthony Sharp via Gcc-patches
thony On Thu, 4 Feb 2021 at 16:33, Jason Merrill wrote: > > On 2/4/21 11:24 AM, Jason Merrill wrote: > > On 2/4/21 10:02 AM, Anthony Sharp via Gcc-patches wrote: > >> Hello, > >> > >> New bugfix for PR19377 > >> (https://gcc.gnu.org/bugzilla/show

[PATCH] c++: Private parent access check for using decls [PR19377]

2021-02-04 Thread Anthony Sharp via Gcc-patches
Hello, New bugfix for PR19377 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=19377). This is basically an extension of what I did before for PR17314 except it also fixes this other bug. I hope I didn't over-comment in the code ... better to say too much than too little! It's a niche bug so I thoug

Re: [PATCH] c++: private inheritance access diagnostics fix [PR17314]

2021-01-22 Thread Anthony Sharp via Gcc-patches
Hi Jason, Attached changes. I just edited the patch file directly. Kind regards, Anthony From 7984020f16e715017e62b8637d2e69c1aec3478a Mon Sep 17 00:00:00 2001 From: Anthony Sharp Date: Thu, 21 Jan 2021 15:26:25 + Subject: [PATCH] c++: Private inheritance access diagnostics fix [PR17314] Th

Re: [PATCH] c++: private inheritance access diagnostics fix [PR17314]

2021-01-22 Thread Anthony Sharp via Gcc-patches
Hi Jason, Thanks for getting back to me so quickly. > Why two gcc-comit-mklog? That would generate the log entries twice. It did in fact generate the log entries twice, but I deleted out the second copy. Perhaps it would have made more sense to do git commit --amend instead. > Instead of makin

Re: [PATCH] c++: private inheritance access diagnostics fix [PR17314]

2021-01-21 Thread Anthony Sharp via Gcc-patches
Hi Jason, I've finally completed my copyright assignment form. I've attached it to this email for reference. > You don't need write access to the main repository to use these commands > on your local copy. One nice thing about git compared to svn is that > you don't need to touch the server for

Re: [PATCH] c++: private inheritance access diagnostics fix [PR17314]

2021-01-08 Thread Anthony Sharp via Gcc-patches
Hi Jason, Thank you! > To start with, do you have a copyright assignment on file or in the > works already? Good point. I incorrectly assumed it would only be a minor contribution copyright-wise. Mr Edelsohn gave me a template which I've now filled out and sent to ass...@gnu.org. I'm assuming I

[PATCH] c++: private inheritance access diagnostics fix [PR17314]

2021-01-05 Thread Anthony Sharp via Gcc-patches
This patch fixes PR17314 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=17314). Previously, when class C attempted to access member a declared in class A through class B, where class B privately inherits from A and class C inherits from B, GCC would correctly report an access violation, but would er