diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-01-24 00:59:21 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-01-24 00:59:21 +0000 |
commit | c576929b9768afb15ccfd567e2955cc60b87464c (patch) | |
tree | 71c8c9a0d0e8ac3e0d98a799610459d390d56424 /gcc/cp | |
parent | 757e86737c354d24474fc734004c493a9b09fd65 (diff) | |
download | gcc-c576929b9768afb15ccfd567e2955cc60b87464c.tar.gz |
* 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".
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@24839 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/cp/decl.c | 19 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 2 |
3 files changed, 24 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 280d14db9ad..ab362173528 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 39e07a4ba6e..e1e50f6f46e 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 ed9c11b3824..867cf96c653 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); |