summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>1998-10-13 18:29:36 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>1998-10-13 18:29:36 +0000
commit820b9955dce9166a46f2538ad54582dff2ff5e71 (patch)
treee9dedc1e6bd521e1491bdf14f5b3da5541a261c9
parentc9ff1a07dfbefc45c4b6916c1b125f2e5258af3f (diff)
downloadgcc-820b9955dce9166a46f2538ad54582dff2ff5e71.tar.gz
* tinfo2.cc (fast_compare): Remove.
(before): Just use strcmp. * tinfo.cc (operator==): Just use strcmp. * decl.c (grokfndecl): Don't check for linkage in `extern "C"' declarations. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@23057 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog11
-rw-r--r--gcc/cp/decl.c3
-rw-r--r--gcc/cp/tinfo.cc3
-rw-r--r--gcc/cp/tinfo2.cc15
4 files changed, 17 insertions, 15 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 2a59ec0d412..053fb4b6ae6 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,14 @@
+1998-10-13 Jason Merrill <jason@yorick.cygnus.com>
+
+ * tinfo2.cc (fast_compare): Remove.
+ (before): Just use strcmp.
+ * tinfo.cc (operator==): Just use strcmp.
+
+1998-10-13 Klaus-Georg Adams <Klaus-Georg.Adams@chemie.uni-karlsruhe.de>
+
+ * decl.c (grokfndecl): Don't check for linkage in `extern "C"'
+ declarations.
+
1998-10-13 Mark Mitchell <mark@markmitchell.com>
* cp-tree.h (specializations_of_same_template_p): Remove.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 49c24db6055..91569d07b27 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -8024,7 +8024,8 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
t = no_linkage_check (TREE_TYPE (decl));
if (t)
{
- if (ANON_AGGRNAME_P (TYPE_IDENTIFIER (t)))
+ if (ANON_AGGRNAME_P (TYPE_IDENTIFIER (t))
+ && DECL_LANGUAGE (decl) != lang_c)
cp_pedwarn ("non-local function `%#D' uses anonymous type", decl);
else
cp_pedwarn ("non-local function `%#D' uses local type `%T'",
diff --git a/gcc/cp/tinfo.cc b/gcc/cp/tinfo.cc
index 6de805524e0..23750ac9310 100644
--- a/gcc/cp/tinfo.cc
+++ b/gcc/cp/tinfo.cc
@@ -28,6 +28,7 @@
#pragma implementation "typeinfo"
#include <stddef.h>
+#include <string.h>
#include "tinfo.h"
#include "new" // for placement new
@@ -43,7 +44,7 @@ std::type_info::
bool type_info::
operator== (const type_info& arg) const
{
- return (&arg == this) || (fast_compare (name (), arg.name ()) == 0);
+ return (&arg == this) || (strcmp (name (), arg.name ()) == 0);
}
extern "C" void
diff --git a/gcc/cp/tinfo2.cc b/gcc/cp/tinfo2.cc
index c19cf607762..e4d78fd949a 100644
--- a/gcc/cp/tinfo2.cc
+++ b/gcc/cp/tinfo2.cc
@@ -26,27 +26,16 @@
// the executable file might be covered by the GNU General Public License.
#include <stddef.h>
+#include <string.h>
#include "tinfo.h"
#include "new" // for placement new
using std::type_info;
-// service function for comparing types by name.
-
-static inline int
-fast_compare (const char *n1, const char *n2) {
- int c;
- if (n1 == n2) return 0;
- if (n1 == 0) return *n2;
- else if (n2 == 0) return *n1;
-
- c = (int)*n1++ - (int)*n2++;
- return c == 0 ? strcmp (n1, n2) : c;
-};
bool
type_info::before (const type_info &arg) const
{
- return fast_compare (name (), arg.name ()) < 0;
+ return strcmp (name (), arg.name ()) < 0;
}
// type info for pointer type.