]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Ensure C++ language linkage in cmath and cstdlib
authorJonathan Wakely <jwakely@redhat.com>
Wed, 20 Jan 2016 12:34:25 +0000 (12:34 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 20 Jan 2016 12:34:25 +0000 (12:34 +0000)
PR libstdc++/69386
* include/c_global/ccomplex: Ensure C++ language linkage.
* include/c_global/cmath: Likewise.
* include/c_global/cstdlib: Likewise.
* include/c_global/ctgmath: Likewise.
* testsuite/17_intro/headers/c++2011/linkage.cc: New.

From-SVN: r232607

libstdc++-v3/ChangeLog
libstdc++-v3/include/c_global/ccomplex
libstdc++-v3/include/c_global/cmath
libstdc++-v3/include/c_global/cstdlib
libstdc++-v3/include/c_global/ctgmath
libstdc++-v3/testsuite/17_intro/headers/c++2011/linkage.cc [new file with mode: 0644]

index 4bf6e259e586963ea02e3a66d5bf6a215a8fddd2..b78a2f74836d41c09cbb8b723edf9b93d223d33a 100644 (file)
@@ -1,3 +1,12 @@
+2016-01-20  Jonathan Wakely  <jwakely@redhat.com>
+
+       PR libstdc++/69386
+       * include/c_global/ccomplex: Ensure C++ language linkage.
+       * include/c_global/cmath: Likewise.
+       * include/c_global/cstdlib: Likewise.
+       * include/c_global/ctgmath: Likewise.
+       * testsuite/17_intro/headers/c++2011/linkage.cc: New.
+
 2016-01-19  Jonathan Wakely  <jwakely@redhat.com>
 
        PR libstdc++/14608
index 8879e20ee830f1eabb059616cdd1dfa031aa6c3c..df2e413739dac0dfe38b9b606d4d39a37c12a72b 100644 (file)
@@ -35,6 +35,8 @@
 # include <bits/c++0x_warning.h>
 #endif
 
+extern "C++" {
 #include <complex>
+}
 
 #endif
index 45e40ab3dc16ed8be00439002c100ed3f20d1342..c4ee3f57fc373a065b96b20f08baf99b63f0c604 100644 (file)
@@ -74,6 +74,8 @@
 #undef tan
 #undef tanh
 
+extern "C++"
+{
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -1790,4 +1792,6 @@ _GLIBCXX_END_NAMESPACE_VERSION
 #  include <bits/specfun.h>
 #endif
 
+} // extern "C++"
+
 #endif
index 44b6e5c709c0696bc844617483b230b4ae905b23..1ba5fb7f03ad509d7663ad610c250a72789b02a3 100644 (file)
@@ -115,6 +115,8 @@ namespace std
 #undef wcstombs
 #undef wctomb
 
+extern "C++"
+{
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -272,6 +274,8 @@ namespace std
 
 #endif // _GLIBCXX_USE_C99_STDLIB
 
+} // extern "C++"
+
 #endif // !_GLIBCXX_HOSTED
 
 #endif
index 2fee958484c32352f70e677e40b087d2fa5654aa..4314516fe4d5491ae07bc112164aa6bae8a8c71b 100644 (file)
@@ -35,7 +35,9 @@
 #  include <bits/c++0x_warning.h>
 #else
 #  include <cmath>
+extern "C++" {
 #  include <complex>
+}
 #endif
 
 #endif 
diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2011/linkage.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2011/linkage.cc
new file mode 100644 (file)
index 0000000..33e7053
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (C) 2016 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+// libstdc++/69386
+
+extern "C"
+{
+#include <assert.h>
+#include <complex.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fenv.h>
+#include <float.h>
+#include <inttypes.h>
+#include <iso646.h>
+#include <limits.h>
+#include <locale.h>
+#include <math.h>
+#include <setjmp.h>
+#include <signal.h>
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <tgmath.h>
+#include <time.h>
+#include <uchar.h>
+#include <wchar.h>
+#include <wctype.h>
+}