aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>1998-08-23 22:00:27 -0400
committerJason Merrill <jason@gcc.gnu.org>1998-08-23 22:00:27 -0400
commit319285566b1f3cca49a1188fc6825e794982caa9 (patch)
treea43d43e79841f8444f2ddf523b8c1e40d2635c69 /gcc
parent46fe53810a6cd815c8c34d9e233912f7642d0582 (diff)
downloadgcc-319285566b1f3cca49a1188fc6825e794982caa9.zip
gcc-319285566b1f3cca49a1188fc6825e794982caa9.tar.gz
gcc-319285566b1f3cca49a1188fc6825e794982caa9.tar.bz2
lex.c (real_yylex): Don't warn about long long constants if we're allowing long long.
* lex.c (real_yylex): Don't warn about long long constants if we're allowing long long. * decl.c (pushdecl): Use IDENTIFIER_NAMESPACE_VALUE instead of accessing bindings directly. * lang-specs.h: Remove __HONOR_STD. * inc/exception, inc/new, inc/new.h, inc/typeinfo: Likewise. From-SVN: r21926
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog13
-rw-r--r--gcc/cp/decl.c34
-rw-r--r--gcc/cp/inc/exception4
-rw-r--r--gcc/cp/inc/new4
-rw-r--r--gcc/cp/inc/new.h2
-rw-r--r--gcc/cp/inc/typeinfo4
-rw-r--r--gcc/cp/lang-specs.h3
-rw-r--r--gcc/cp/lex.c2
8 files changed, 30 insertions, 36 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 4fa3740..3e51108 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,16 @@
+1998-08-24 Nathan Sidwell <nathan@acm.org>
+
+ * lex.c (real_yylex): Don't warn about long long constants if
+ we're allowing long long.
+
+1998-08-23 Martin von Löwis <loewis@informatik.hu-berlin.de>
+
+ * decl.c (pushdecl): Use IDENTIFIER_NAMESPACE_VALUE instead of
+ accessing bindings directly.
+
+ * lang-specs.h: Remove __HONOR_STD.
+ * inc/exception, inc/new, inc/new.h, inc/typeinfo: Likewise.
+
1998-08-23 Mark Mitchell <mark@markmitchell.com>
* decl.c (grokdeclarator): Complain about in-class initialization
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 5940996..4942b5d 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -3503,12 +3503,11 @@ pushdecl (x)
if (TREE_PUBLIC (x) && TREE_CODE (x) != FUNCTION_DECL)
{
tree decl;
- tree bindings = binding_for_name (name, current_namespace);
- if (BINDING_VALUE (bindings) != NULL_TREE
- && (DECL_EXTERNAL (BINDING_VALUE (bindings))
- || TREE_PUBLIC (BINDING_VALUE (bindings))))
- decl = BINDING_VALUE (bindings);
+ if (IDENTIFIER_NAMESPACE_VALUE (name) != NULL_TREE
+ && (DECL_EXTERNAL (IDENTIFIER_NAMESPACE_VALUE (name))
+ || TREE_PUBLIC (IDENTIFIER_NAMESPACE_VALUE (name))))
+ decl = IDENTIFIER_NAMESPACE_VALUE (name);
else
decl = NULL_TREE;
@@ -3527,11 +3526,10 @@ pushdecl (x)
if (namespace_bindings_p ())
{
/* Install a global value. */
- tree bindings = binding_for_name (name, current_namespace);
/* If the first global decl has external linkage,
warn if we later see static one. */
- if (BINDING_VALUE (bindings) == NULL_TREE && TREE_PUBLIC (x))
+ if (IDENTIFIER_GLOBAL_VALUE (name) == NULL_TREE && TREE_PUBLIC (x))
TREE_PUBLIC (name) = 1;
/* Don't install an artificial TYPE_DECL if we already have
@@ -3541,9 +3539,10 @@ pushdecl (x)
|| ! DECL_ARTIFICIAL (x))
{
if (TREE_CODE (x) == FUNCTION_DECL)
- my_friendly_assert ((BINDING_VALUE (bindings) == NULL_TREE)
- || BINDING_VALUE (bindings) == x, 378);
- BINDING_VALUE (bindings) = x;
+ my_friendly_assert
+ ((IDENTIFIER_GLOBAL_VALUE (name) == NULL_TREE)
+ || (IDENTIFIER_GLOBAL_VALUE (name) == x), 378);
+ SET_IDENTIFIER_NAMESPACE_VALUE (name, x);
}
/* Don't forget if the function was used via an implicit decl. */
@@ -3573,7 +3572,7 @@ pushdecl (x)
{
/* Here to install a non-global value. */
tree oldlocal = IDENTIFIER_LOCAL_VALUE (name);
- tree oldglobal = binding_for_name (name, current_namespace);
+ tree oldglobal = IDENTIFIER_NAMESPACE_VALUE (name);
/* Don't install an artificial TYPE_DECL if we already have
another _DECL with that name. */
@@ -3596,24 +3595,24 @@ pushdecl (x)
have a global definition or declaration for the function. */
if (oldlocal == NULL_TREE
&& DECL_EXTERNAL (x)
- && BINDING_VALUE (oldglobal) != NULL_TREE
+ && oldglobal != NULL_TREE
&& TREE_CODE (x) == FUNCTION_DECL
- && TREE_CODE (BINDING_VALUE (oldglobal)) == FUNCTION_DECL)
+ && TREE_CODE (oldglobal) == FUNCTION_DECL)
{
/* We have one. Their types must agree. */
- if (decls_match (x, BINDING_VALUE (oldglobal)))
+ if (decls_match (x, oldglobal))
/* OK */;
else
{
cp_warning ("extern declaration of `%#D' doesn't match", x);
- cp_warning_at ("global declaration `%#D'", BINDING_VALUE (oldglobal));
+ cp_warning_at ("global declaration `%#D'", oldglobal);
}
}
/* If we have a local external declaration,
and no file-scope declaration has yet been seen,
then if we later have a file-scope decl it must not be static. */
if (oldlocal == NULL_TREE
- && BINDING_VALUE (oldglobal) == NULL_TREE
+ && oldglobal == NULL_TREE
&& DECL_EXTERNAL (x)
&& TREE_PUBLIC (x))
{
@@ -3663,7 +3662,7 @@ pushdecl (x)
warnstring = "declaration of `%s' shadows a member of `this'";
else if (oldlocal != NULL_TREE)
warnstring = "declaration of `%s' shadows previous local";
- else if (BINDING_VALUE (oldglobal) != NULL_TREE)
+ else if (oldglobal != NULL_TREE)
/* XXX shadow warnings in outer-more namespaces */
warnstring = "declaration of `%s' shadows global declaration";
@@ -4505,7 +4504,6 @@ lookup_tag (form, name, binding_level, thislevel_only)
}
else if (level->namespace_p)
/* Do namespace lookup. */
- /* XXX: is this a real lookup, considering using-directives etc. ??? */
for (tail = current_namespace; 1; tail = CP_DECL_CONTEXT (tail))
{
tree old = binding_for_name (name, tail);
diff --git a/gcc/cp/inc/exception b/gcc/cp/inc/exception
index 9954146..b7aa1f4 100644
--- a/gcc/cp/inc/exception
+++ b/gcc/cp/inc/exception
@@ -8,9 +8,7 @@
extern "C++" {
-#ifdef __HONOR_STD
namespace std {
-#endif
class exception {
public:
@@ -34,9 +32,7 @@ unexpected_handler set_unexpected (unexpected_handler);
void unexpected () __attribute__ ((__noreturn__));
bool uncaught_exception ();
-#ifdef __HONOR_STD
} // namespace std
-#endif
} // extern "C++"
diff --git a/gcc/cp/inc/new b/gcc/cp/inc/new
index 0f25a5c..93a3231 100644
--- a/gcc/cp/inc/new
+++ b/gcc/cp/inc/new
@@ -10,9 +10,7 @@
extern "C++" {
-#ifdef __HONOR_STD
namespace std {
-#endif
class bad_alloc : public exception {
public:
@@ -24,9 +22,7 @@ namespace std {
typedef void (*new_handler)();
new_handler set_new_handler (new_handler);
-#ifdef __HONOR_STD
} // namespace std
-#endif
// replaceable signatures
void *operator new (size_t) throw (std::bad_alloc);
diff --git a/gcc/cp/inc/new.h b/gcc/cp/inc/new.h
index 799db7e..006be7e 100644
--- a/gcc/cp/inc/new.h
+++ b/gcc/cp/inc/new.h
@@ -5,9 +5,7 @@
#include <new>
-#ifdef __HONOR_STD
using std::new_handler;
using std::set_new_handler;
-#endif
#endif // __NEW_H__
diff --git a/gcc/cp/inc/typeinfo b/gcc/cp/inc/typeinfo
index 64b2a81..a735525 100644
--- a/gcc/cp/inc/typeinfo
+++ b/gcc/cp/inc/typeinfo
@@ -8,9 +8,7 @@
extern "C++" {
-#ifdef __HONOR_STD
namespace std {
-#endif
class type_info {
private:
@@ -63,9 +61,7 @@ class bad_typeid : public exception {
virtual ~bad_typeid () { }
};
-#ifdef __HONOR_STD
} // namespace std
-#endif
} // extern "C++"
#endif
diff --git a/gcc/cp/lang-specs.h b/gcc/cp/lang-specs.h
index b208ca1..8daebbc 100644
--- a/gcc/cp/lang-specs.h
+++ b/gcc/cp/lang-specs.h
@@ -36,7 +36,6 @@ Boston, MA 02111-1307, USA. */
-undef -D__GNUC__=%v1 -D__GNUG__=%v1 -D__cplusplus -D__GNUC_MINOR__=%v2\
%{ansi:-trigraphs -D__STRICT_ANSI__} %{!undef:%{!ansi:%p} %P}\
%{!fno-exceptions:-D__EXCEPTIONS}\
- %{fhonor-std:-D__HONOR_STD} %{fnew-abi:-D__HONOR_STD}\
%c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}} %{trigraphs}\
%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
%i %{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}}\n}\
@@ -46,7 +45,6 @@ Boston, MA 02111-1307, USA. */
-D__GNUC_MINOR__=%v2\
%{ansi:-trigraphs -D__STRICT_ANSI__} %{!undef:%{!ansi:%p} %P}\
%{!fno-exceptions:-D__EXCEPTIONS}\
- %{fhonor-std:-D__HONOR_STD} %{fnew-abi:-D__HONOR_STD}\
%c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
%{trigraphs}\
%{!Q:-quiet} -dumpbase %b.cc %{d*} %{m*} %{a}\
@@ -66,7 +64,6 @@ Boston, MA 02111-1307, USA. */
-undef -D__GNUC__=%v1 -D__GNUG__=%v1 -D__cplusplus -D__GNUC_MINOR__=%v2\
%{ansi:-trigraphs -D__STRICT_ANSI__} %{!undef:%{!ansi:%p} %P}\
%{!fno-exceptions:-D__EXCEPTIONS}\
- %{fhonor-std:-D__HONOR_STD} %{fnew-abi:-D__HONOR_STD}\
%c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}} %{trigraphs}\
%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
%i %{!M:%{!MM:%{!E:%{!pipe:%g.ii}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n",
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index 8ded741..36c5c74 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -3823,7 +3823,7 @@ real_yylex ()
{
if (spec_long_long)
error ("three `l's in integer constant");
- else if (pedantic)
+ else if (pedantic && ! in_system_header && warn_long_long)
pedwarn ("ANSI C++ forbids long long integer constants");
spec_long_long = 1;
}