* [PATCH] c++: remove redundand NULL check.
@ 2021-04-21 8:19 Martin Liška
2021-04-29 12:23 ` Richard Biener
0 siblings, 1 reply; 2+ messages in thread
From: Martin Liška @ 2021-04-21 8:19 UTC (permalink / raw)
To: gcc-patches
The check is redundant.
Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
Ready to be installed?
Thanks,
Martin
gcc/cp/ChangeLog:
PR c++/99616
* decl.c (grokdeclarator): Remove redundant NULL check.
---
gcc/cp/decl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 8e8f37d060e..dc2c79997ee 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -12244,7 +12244,7 @@ grokdeclarator (const cp_declarator *declarator,
int attr_flags;
attr_flags = 0;
- if (declarator == NULL || declarator->kind == cdk_id)
+ if (declarator->kind == cdk_id)
attr_flags |= (int) ATTR_FLAG_DECL_NEXT;
if (declarator->kind == cdk_function)
attr_flags |= (int) ATTR_FLAG_FUNCTION_NEXT;
--
2.31.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] c++: remove redundand NULL check.
2021-04-21 8:19 [PATCH] c++: remove redundand NULL check Martin Liška
@ 2021-04-29 12:23 ` Richard Biener
0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2021-04-29 12:23 UTC (permalink / raw)
To: Martin Liška; +Cc: GCC Patches
On Wed, Apr 21, 2021 at 11:19 AM Martin Liška <mliska@suse.cz> wrote:
>
> The check is redundant.
>
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
>
> Ready to be installed?
OK.
> Thanks,
> Martin
>
> gcc/cp/ChangeLog:
>
> PR c++/99616
> * decl.c (grokdeclarator): Remove redundant NULL check.
> ---
> gcc/cp/decl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
> index 8e8f37d060e..dc2c79997ee 100644
> --- a/gcc/cp/decl.c
> +++ b/gcc/cp/decl.c
> @@ -12244,7 +12244,7 @@ grokdeclarator (const cp_declarator *declarator,
> int attr_flags;
>
> attr_flags = 0;
> - if (declarator == NULL || declarator->kind == cdk_id)
> + if (declarator->kind == cdk_id)
> attr_flags |= (int) ATTR_FLAG_DECL_NEXT;
> if (declarator->kind == cdk_function)
> attr_flags |= (int) ATTR_FLAG_FUNCTION_NEXT;
> --
> 2.31.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-04-29 12:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-21 8:19 [PATCH] c++: remove redundand NULL check Martin Liška
2021-04-29 12:23 ` Richard Biener
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).