diff options
author | Marek Polacek <polacek@redhat.com> | 2018-03-05 16:15:35 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2018-03-05 16:15:35 +0000 |
commit | a2460abb82e2fd3c45edf5e9f4ff61151ef8d815 (patch) | |
tree | cdb2c2979cad7cb62d24b4520044167567b93bb0 /gcc/cp | |
parent | a5dccd4614b84381f6799ae0162cd0859de0fc86 (diff) | |
download | gcc-a2460abb82e2fd3c45edf5e9f4ff61151ef8d815.zip gcc-a2460abb82e2fd3c45edf5e9f4ff61151ef8d815.tar.gz gcc-a2460abb82e2fd3c45edf5e9f4ff61151ef8d815.tar.bz2 |
re PR c++/84707 (internal compiler error: Segmentation fault (tree_check()/duplicate_decls()))
PR c++/84707
* decl.c (duplicate_decls): Check DECL_NAME before accessing
UDLIT_OPER_P.
* g++.dg/cpp0x/inline-ns10.C: New test.
From-SVN: r258255
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/decl.c | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6c37dc3..001cb6a 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2018-03-05 Marek Polacek <polacek@redhat.com> + + PR c++/84707 + * decl.c (duplicate_decls): Check DECL_NAME before accessing + UDLIT_OPER_P. + 2018-03-05 Nathan Sidwell <nathan@acm.org> PR c++/84694 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 1866e8f..b2e19a6 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -1410,7 +1410,9 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend) || TREE_TYPE (olddecl) == error_mark_node) return error_mark_node; - if (UDLIT_OPER_P (DECL_NAME (newdecl)) + if (DECL_NAME (newdecl) + && DECL_NAME (olddecl) + && UDLIT_OPER_P (DECL_NAME (newdecl)) && UDLIT_OPER_P (DECL_NAME (olddecl))) { if (TREE_CODE (newdecl) == TEMPLATE_DECL |