aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@yorick.cygnus.com>1999-01-24 00:59:21 +0000
committerJason Merrill <jason@gcc.gnu.org>1999-01-23 19:59:21 -0500
commit1f9017930217253ea79443d063677b0a05a2c0af (patch)
tree71c8c9a0d0e8ac3e0d98a799610459d390d56424 /gcc
parentc0e228490dd9d6aadf97b70477bb559ce79809df (diff)
downloadgcc-1f9017930217253ea79443d063677b0a05a2c0af.zip
gcc-1f9017930217253ea79443d063677b0a05a2c0af.tar.gz
gcc-1f9017930217253ea79443d063677b0a05a2c0af.tar.bz2
decl.c (start_function): Make member functions one_only on windows.
* decl.c (start_function): Make member functions one_only on windows. * decl2.c (import_export_decl): Likewise. * decl.c (grokdeclarator): Don't complain about implicit int in a system header. Change same-name field check to not complain in a system header instead of within extern "C". From-SVN: r24839
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog9
-rw-r--r--gcc/cp/decl.c19
-rw-r--r--gcc/cp/decl2.c2
3 files changed, 24 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 280d14d..ab36217 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,12 @@
+1999-01-24 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl.c (start_function): Make member functions one_only on windows.
+ * decl2.c (import_export_decl): Likewise.
+
+ * decl.c (grokdeclarator): Don't complain about implicit int in
+ a system header. Change same-name field check to not complain in
+ a system header instead of within extern "C".
+
1999-01-21 Mark Mitchell <mark@markmitchell.com>
* cp-tree.h (PUSH_GLOBAL): New macro.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 39e07a4..e1e50f6 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -9384,7 +9384,9 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
&& in_namespace == NULL_TREE
&& current_namespace == global_namespace);
- if (pedantic || ! is_main)
+ if (in_system_header)
+ /* Allow it, sigh. */;
+ else if (pedantic || ! is_main)
cp_pedwarn ("ANSI C++ forbids declaration `%D' with no type",
dname);
else if (warn_return_type)
@@ -11050,7 +11052,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
/* Divergence from the standard: In extern "C", we
allow non-static data members here, because C does
and /usr/include/netinet/in.h uses that. */
- && (staticp || current_lang_name != lang_name_c))
+ && (staticp || ! in_system_header))
cp_pedwarn ("ANSI C++ forbids data member `%D' with same name as enclosing class",
declarator);
@@ -13042,16 +13044,21 @@ start_function (declspecs, declarator, attrs, pre_parsed_p)
}
/* If this function belongs to an interface, it is public.
If it belongs to someone else's interface, it is also external.
- It doesn't matter whether it's inline or not. */
+ This only affects inlines and template instantiations. */
else if (interface_unknown == 0
&& (! DECL_TEMPLATE_INSTANTIATION (decl1)
|| flag_alt_external_templates))
{
if (DECL_THIS_INLINE (decl1) || DECL_TEMPLATE_INSTANTIATION (decl1)
|| processing_template_decl)
- DECL_EXTERNAL (decl1)
- = (interface_only
- || (DECL_THIS_INLINE (decl1) && ! flag_implement_inlines));
+ {
+ DECL_EXTERNAL (decl1)
+ = (interface_only
+ || (DECL_THIS_INLINE (decl1) && ! flag_implement_inlines));
+
+ /* For WIN32 we also want to put these in linkonce sections. */
+ maybe_make_one_only (decl1);
+ }
else
DECL_EXTERNAL (decl1) = 0;
DECL_NOT_REALLY_EXTERN (decl1) = 0;
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index ed9c11b..867cf96 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -2791,6 +2791,8 @@ import_export_decl (decl)
/* Always make artificials weak. */
if (DECL_ARTIFICIAL (decl) && flag_weak)
comdat_linkage (decl);
+ else
+ maybe_make_one_only (decl);
}
else
comdat_linkage (decl);