aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl2.c4
-rw-r--r--gcc/cp/method.c3
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/externC2.C16
4 files changed, 25 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 83224d8..1bccc36 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2000-05-26 Mark Mitchell <mark@codesourcery.com>
+
+ * decl2.c (grokclassfn): Set DECL_LANGUAGE here.
+ * method.c (implicitly_declare_fn): Not here.
+
2000-05-26 Nathan Sidwell <nathan@codesourcery.com>
* cp-tree.h (CPTI_PTMD_DESC_TYPE): Rename to ...
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 315e3c8..11250e7 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -1034,6 +1034,10 @@ grokclassfn (ctype, function, flags, quals)
tree fn_name = DECL_NAME (function);
int this_quals = TYPE_UNQUALIFIED;
+ /* Even within an `extern "C"' block, members get C++ linkage. See
+ [dcl.link] for details. */
+ DECL_LANGUAGE (function) = lang_cplusplus;
+
if (fn_name == NULL_TREE)
{
error ("name missing for member function");
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 53b5153..6d34795 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -2581,9 +2581,6 @@ implicitly_declare_fn (kind, type, const_p)
DECL_NOT_REALLY_EXTERN (fn) = 1;
DECL_THIS_INLINE (fn) = 1;
DECL_INLINE (fn) = 1;
- /* Even within an `extern "C"' block, members get C++ linkage. See
- [dcl.link] for details. */
- DECL_LANGUAGE (fn) = lang_cplusplus;
defer_fn (fn);
return fn;
diff --git a/gcc/testsuite/g++.old-deja/g++.other/externC2.C b/gcc/testsuite/g++.old-deja/g++.other/externC2.C
new file mode 100644
index 0000000..86d3736
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/externC2.C
@@ -0,0 +1,16 @@
+// Build don't link:
+// Origin: Boris Zentner <boris@m2b.de>
+
+extern "C"
+{
+struct xx
+{
+ int x;
+ xx();
+};
+
+xx::xx()
+{
+ x = 0;
+}
+}