public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/marxin/heads/add-better-STATIC_ASSERT)] Use STATIC_ASSERT for OVL_OP_MAX.
@ 2021-03-12 13:32 Martin Liska
0 siblings, 0 replies; 3+ messages in thread
From: Martin Liska @ 2021-03-12 13:32 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:7996d98c465775fc473552cf0712da9e6aac0b2f
commit 7996d98c465775fc473552cf0712da9e6aac0b2f
Author: Martin Liska <mliska@suse.cz>
Date: Fri Mar 12 14:32:07 2021 +0100
Use STATIC_ASSERT for OVL_OP_MAX.
Diff:
---
gcc/cp/cp-tree.h | 3 +++
gcc/cp/lex.c | 2 --
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 81ff375f8a5..a8f72448ea9 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -5916,6 +5916,9 @@ enum ovl_op_code {
OVL_OP_MAX
};
+/* Make sure it fits in lang_decl_fn::operator_code. */
+STATIC_ASSERT (OVL_OP_MAX < (1 << 6));
+
struct GTY(()) ovl_op_info_t {
/* The IDENTIFIER_NODE for the operator. */
tree identifier;
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index 73e14b8394c..43abd019e6e 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -166,8 +166,6 @@ init_operators (void)
if (op_ptr->name)
{
- /* Make sure it fits in lang_decl_fn::operator_code. */
- gcc_checking_assert (op_ptr->ovl_op_code < (1 << 6));
tree ident = set_operator_ident (op_ptr);
if (unsigned index = IDENTIFIER_CP_INDEX (ident))
{
^ permalink raw reply [flat|nested] 3+ messages in thread
* [gcc(refs/users/marxin/heads/add-better-STATIC_ASSERT)] Use STATIC_ASSERT for OVL_OP_MAX.
@ 2021-04-22 8:53 Martin Liska
0 siblings, 0 replies; 3+ messages in thread
From: Martin Liska @ 2021-04-22 8:53 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:e035fd0549ea17ab4f8d71488f577fd1e4077fd9
commit e035fd0549ea17ab4f8d71488f577fd1e4077fd9
Author: Martin Liska <mliska@suse.cz>
Date: Fri Mar 12 14:32:07 2021 +0100
Use STATIC_ASSERT for OVL_OP_MAX.
gcc/cp/ChangeLog:
* cp-tree.h (STATIC_ASSERT): Prefer static assert.
* lex.c (init_operators): Remove run-time check.
Diff:
---
gcc/cp/cp-tree.h | 3 +++
gcc/cp/lex.c | 2 --
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 23a77a2b2e0..cb254e0adea 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -5922,6 +5922,9 @@ enum ovl_op_code {
OVL_OP_MAX
};
+/* Make sure it fits in lang_decl_fn::ovl_op_code. */
+STATIC_ASSERT (OVL_OP_MAX < (1 << 6));
+
struct GTY(()) ovl_op_info_t {
/* The IDENTIFIER_NODE for the operator. */
tree identifier;
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index 73e14b8394c..43abd019e6e 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -166,8 +166,6 @@ init_operators (void)
if (op_ptr->name)
{
- /* Make sure it fits in lang_decl_fn::operator_code. */
- gcc_checking_assert (op_ptr->ovl_op_code < (1 << 6));
tree ident = set_operator_ident (op_ptr);
if (unsigned index = IDENTIFIER_CP_INDEX (ident))
{
^ permalink raw reply [flat|nested] 3+ messages in thread
* [gcc(refs/users/marxin/heads/add-better-STATIC_ASSERT)] Use STATIC_ASSERT for OVL_OP_MAX.
@ 2021-03-18 16:00 Martin Liska
0 siblings, 0 replies; 3+ messages in thread
From: Martin Liska @ 2021-03-18 16:00 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:a938ccd11f00c469e4497d53f3b9be6c681b7927
commit a938ccd11f00c469e4497d53f3b9be6c681b7927
Author: Martin Liska <mliska@suse.cz>
Date: Fri Mar 12 14:32:07 2021 +0100
Use STATIC_ASSERT for OVL_OP_MAX.
gcc/cp/ChangeLog:
* cp-tree.h (STATIC_ASSERT): Prefer static assert.
* lex.c (init_operators): Remove run-time check.
Diff:
---
gcc/cp/cp-tree.h | 3 +++
gcc/cp/lex.c | 2 --
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 81ff375f8a5..a8f72448ea9 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -5916,6 +5916,9 @@ enum ovl_op_code {
OVL_OP_MAX
};
+/* Make sure it fits in lang_decl_fn::operator_code. */
+STATIC_ASSERT (OVL_OP_MAX < (1 << 6));
+
struct GTY(()) ovl_op_info_t {
/* The IDENTIFIER_NODE for the operator. */
tree identifier;
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index 73e14b8394c..43abd019e6e 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -166,8 +166,6 @@ init_operators (void)
if (op_ptr->name)
{
- /* Make sure it fits in lang_decl_fn::operator_code. */
- gcc_checking_assert (op_ptr->ovl_op_code < (1 << 6));
tree ident = set_operator_ident (op_ptr);
if (unsigned index = IDENTIFIER_CP_INDEX (ident))
{
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-04-22 8:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-12 13:32 [gcc(refs/users/marxin/heads/add-better-STATIC_ASSERT)] Use STATIC_ASSERT for OVL_OP_MAX Martin Liska
2021-03-18 16:00 Martin Liska
2021-04-22 8:53 Martin Liska
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).