public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [C++ Patch] PR 58846
@ 2014-01-29 15:16 Paolo Carlini
  2014-01-29 16:54 ` Jason Merrill
  2014-02-04  9:55 ` Rainer Orth
  0 siblings, 2 replies; 4+ messages in thread
From: Paolo Carlini @ 2014-01-29 15:16 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jason Merrill

[-- Attachment #1: Type: text/plain, Size: 247 bytes --]

Hi,

a very minor ICE on invalid regression, but since we explicitly allow 
for redeclarations (also see comments in declare_global_var) we may as 
well avoid crashing, at least in mainline. Tested x86_64-linux.

Thanks,
Paolo.

/////////////////

[-- Attachment #2: CL_58846 --]
[-- Type: text/plain, Size: 274 bytes --]

/cp
2014-01-29  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/58846
	* decl.c (get_dso_handle_node): Don't crash if dso_handle_node
	== error_mark_node.

/testsuite
2014-01-29  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/58846
	* g++.dg/init/dso_handle2.C: New.

[-- Attachment #3: patch_58846 --]
[-- Type: text/plain, Size: 936 bytes --]

Index: cp/decl.c
===================================================================
--- cp/decl.c	(revision 207234)
+++ cp/decl.c	(working copy)
@@ -6709,8 +6709,11 @@ get_dso_handle_node (void)
 					ptr_type_node);
 
 #ifdef HAVE_GAS_HIDDEN
-  DECL_VISIBILITY (dso_handle_node) = VISIBILITY_HIDDEN;
-  DECL_VISIBILITY_SPECIFIED (dso_handle_node) = 1;
+  if (dso_handle_node != error_mark_node)
+    {
+      DECL_VISIBILITY (dso_handle_node) = VISIBILITY_HIDDEN;
+      DECL_VISIBILITY_SPECIFIED (dso_handle_node) = 1;
+    }
 #endif
 
   return dso_handle_node;
Index: testsuite/g++.dg/init/dso_handle2.C
===================================================================
--- testsuite/g++.dg/init/dso_handle2.C	(revision 0)
+++ testsuite/g++.dg/init/dso_handle2.C	(working copy)
@@ -0,0 +1,10 @@
+// PR c++/58846
+
+extern "C" { char* __dso_handle; }
+
+struct A
+{
+  ~A();
+};
+
+A a;  // { dg-error "conflicting declaration" }

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-02-04 10:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-29 15:16 [C++ Patch] PR 58846 Paolo Carlini
2014-01-29 16:54 ` Jason Merrill
2014-02-04  9:55 ` Rainer Orth
2014-02-04 10:17   ` Paolo Carlini

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