[Bug c++/84707] [8 Regression] internal compiler error: Segmentation fault (tree_check()/duplicate_decls())

2019-03-29 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84707

Richard Biener  changed:

   What|Removed |Added

   Keywords|ice-on-valid-code   |rejects-valid
   Priority|P1  |P2
 Status|REOPENED|RESOLVED
  Known to work||7.4.0, 8.3.0, 9.0
 Resolution|--- |FIXED
   Target Milestone|8.0 |8.3
  Known to fail||8.1.0, 8.2.0

--- Comment #14 from Richard Biener  ---
GCC 8.3 accepts it w/o error.

[Bug c++/84707] [8 Regression] internal compiler error: Segmentation fault (tree_check()/duplicate_decls())

2018-09-25 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84707

Nathan Sidwell  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |---

--- Comment #13 from Nathan Sidwell  ---
there should be no error

[Bug c++/84707] [8 Regression] internal compiler error: Segmentation fault (tree_check()/duplicate_decls())

2018-09-25 Thread vegard.nossum at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84707

Vegard Nossum  changed:

   What|Removed |Added

 CC||vegard.nossum at oracle dot com

--- Comment #12 from Vegard Nossum  ---
(In reply to Nathan Sidwell from comment #11)
> Fixed trunk & gcc8

I just retried this test case and wanted to note that trunk does not warn and
does not give an error, whereas gcc 8.2 gives an error. Is that the
correct/intended behaviour?

[Bug c++/84707] [8 Regression] internal compiler error: Segmentation fault (tree_check()/duplicate_decls())

2018-08-31 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84707

Nathan Sidwell  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #11 from Nathan Sidwell  ---
Fixed trunk & gcc8

[Bug c++/84707] [8 Regression] internal compiler error: Segmentation fault (tree_check()/duplicate_decls())

2018-08-31 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84707

--- Comment #10 from Nathan Sidwell  ---
Author: nathan
Date: Fri Aug 31 12:57:45 2018
New Revision: 264017

URL: https://gcc.gnu.org/viewcvs?rev=264017=gcc=rev
Log:
[PR c++/87155] Anonymous namespace and

https://gcc.gnu.org/ml/gcc-patches/2018-08/msg02031.html
PR c++/87155
PR c++/84707
cp/
* name-lookup.c (name_lookup::search_namespace): Don't look at
inlines when searching for NULL names.
testsuite/
* g++.dg/cpp0x/pr87155.C: New.
* g++.dg/cpp0x/inline-ns10.C: Adjust.

Added:
branches/gcc-8-branch/gcc/testsuite/g++.dg/cpp0x/pr87155.C
Modified:
branches/gcc-8-branch/gcc/cp/ChangeLog
branches/gcc-8-branch/gcc/cp/name-lookup.c
branches/gcc-8-branch/gcc/testsuite/ChangeLog
branches/gcc-8-branch/gcc/testsuite/g++.dg/cpp0x/inline-ns10.C

[Bug c++/84707] [8 Regression] internal compiler error: Segmentation fault (tree_check()/duplicate_decls())

2018-08-31 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84707

--- Comment #9 from Nathan Sidwell  ---
Author: nathan
Date: Fri Aug 31 12:38:00 2018
New Revision: 264016

URL: https://gcc.gnu.org/viewcvs?rev=264016=gcc=rev
Log:
[PR c++/87155] Anonymous namespace and

https://gcc.gnu.org/ml/gcc-patches/2018-08/msg02031.html
PR c++/87155
PR c++/84707
cp/
* name-lookup.c (name_lookup::search_namespace): Don't look at
inlines when searching for NULL names.
testsuite/
* g++.dg/cpp0x/pr87155.C: New.
* g++.dg/cpp0x/inline-ns10.C: Adjust.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/pr87155.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/name-lookup.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/cpp0x/inline-ns10.C

[Bug c++/84707] [8 Regression] internal compiler error: Segmentation fault (tree_check()/duplicate_decls())

2018-08-30 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84707

Marek Polacek  changed:

   What|Removed |Added

   Keywords|ice-on-invalid-code |ice-on-valid-code

--- Comment #8 from Marek Polacek  ---
Oop.  Adjusting the keyword then.

[Bug c++/84707] [8 Regression] internal compiler error: Segmentation fault (tree_check()/duplicate_decls())

2018-08-30 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84707

Nathan Sidwell  changed:

   What|Removed |Added

 Status|RESOLVED|ASSIGNED
 CC||nathan at gcc dot gnu.org
 Resolution|FIXED   |---
   Assignee|mpolacek at gcc dot gnu.org|nathan at gcc dot 
gnu.org

--- Comment #7 from Nathan Sidwell  ---
The code is actually well formed.  the final final namespace decl reopens the
inline anon namespace!

[Bug c++/84707] [8 Regression] internal compiler error: Segmentation fault (tree_check()/duplicate_decls())

2018-03-05 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84707

Marek Polacek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #6 from Marek Polacek  ---
Fixed.

[Bug c++/84707] [8 Regression] internal compiler error: Segmentation fault (tree_check()/duplicate_decls())

2018-03-05 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84707

--- Comment #5 from Marek Polacek  ---
Author: mpolacek
Date: Mon Mar  5 16:15:35 2018
New Revision: 258255

URL: https://gcc.gnu.org/viewcvs?rev=258255=gcc=rev
Log:
PR c++/84707
* decl.c (duplicate_decls): Check DECL_NAME before accessing
UDLIT_OPER_P.

* g++.dg/cpp0x/inline-ns10.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/inline-ns10.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/decl.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/84707] [8 Regression] internal compiler error: Segmentation fault (tree_check()/duplicate_decls())

2018-03-05 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84707

Marek Polacek  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org

[Bug c++/84707] [8 Regression] internal compiler error: Segmentation fault (tree_check()/duplicate_decls())

2018-03-05 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84707

--- Comment #4 from Marek Polacek  ---
It really seems all we need is 

--- 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


then we give a nice error:
84707.C:5:1: error: ‘namespace { }’ conflicts with a previous declaration
 namespace {}
 ^
84707.C:1:8: note: previous declaration ‘namespace { }’
 inline namespace {
^

[Bug c++/84707] [8 Regression] internal compiler error: Segmentation fault (tree_check()/duplicate_decls())

2018-03-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84707

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P1

[Bug c++/84707] [8 Regression] internal compiler error: Segmentation fault (tree_check()/duplicate_decls())

2018-03-05 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84707

--- Comment #3 from Marek Polacek  ---
Started with r253489.  Before that:
error: ‘namespace _GLOBAL__N_1 { }’ conflicts with a previous declaration
 namespace {}

[Bug c++/84707] [8 Regression] internal compiler error: Segmentation fault (tree_check()/duplicate_decls())

2018-03-05 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84707

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-03-05
 Ever confirmed|0   |1

--- Comment #2 from Marek Polacek  ---
We should warn, like clang++:

84707.C:5:1: warning: inline namespace reopened as a non-inline namespace
namespace {}
^
inline 
84707.C:1:18: note: previous definition is here
inline namespace {
 ^
1 warning generated.

[Bug c++/84707] [8 Regression] internal compiler error: Segmentation fault (tree_check()/duplicate_decls())

2018-03-05 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84707

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org
   Target Milestone|--- |8.0
Summary|internal compiler error:|[8 Regression] internal
   |Segmentation fault  |compiler error:
   |(tree_check()/duplicate_dec |Segmentation fault
   |ls())   |(tree_check()/duplicate_dec
   ||ls())

--- Comment #1 from Marek Polacek  ---
Confirmed.