aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2014-01-29 17:58:37 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2014-01-29 17:58:37 +0000
commite8902891fb43760931d37e545732acc2a5f1fc13 (patch)
treee2217a49e71102dfbdbba17f91060ffd77eb1cb4 /gcc
parente1e30986f9d8089f1814e56c15caa6c15a65b885 (diff)
downloadgcc-e8902891fb43760931d37e545732acc2a5f1fc13.zip
gcc-e8902891fb43760931d37e545732acc2a5f1fc13.tar.gz
gcc-e8902891fb43760931d37e545732acc2a5f1fc13.tar.bz2
re PR c++/58846 (ICE redeclaring __dso_handle)
/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. From-SVN: r207276
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/decl.c7
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/init/dso_handle2.C10
4 files changed, 26 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index ff6493a..3215a43 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,11 @@
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.
+
+2014-01-29 Paolo Carlini <paolo.carlini@oracle.com>
+
PR c++/58674
* pt.c (instantiate_template_1): Check for error_mark_node the second
argument too.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 10f4e64..d7e5829 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -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;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index ce325ca..e108609 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2014-01-29 Paolo Carlini <paolo.carlini@oracle.com>
+ PR c++/58846
+ * g++.dg/init/dso_handle2.C: New.
+
+2014-01-29 Paolo Carlini <paolo.carlini@oracle.com>
+
PR c++/58674
* g++.dg/cpp0x/pr58674.C: New.
diff --git a/gcc/testsuite/g++.dg/init/dso_handle2.C b/gcc/testsuite/g++.dg/init/dso_handle2.C
new file mode 100644
index 0000000..d0ffda1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/dso_handle2.C
@@ -0,0 +1,10 @@
+// PR c++/58846
+
+extern "C" { char* __dso_handle; }
+
+struct A
+{
+ ~A();
+};
+
+A a; // { dg-error "conflicting declaration" }