OSDN Git Service

* lex.c (real_yylex): Don't warn about long long constants if
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 24 Aug 1998 02:00:27 +0000 (02:00 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 24 Aug 1998 02:00:27 +0000 (02:00 +0000)
        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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@21926 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/cp/inc/exception
gcc/cp/inc/new
gcc/cp/inc/new.h
gcc/cp/inc/typeinfo
gcc/cp/lang-specs.h
gcc/cp/lex.c

index 4fa3740..3e51108 100644 (file)
@@ -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
index 5940996..4942b5d 100644 (file)
@@ -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);
index 9954146..b7aa1f4 100644 (file)
@@ -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++"
 
index 0f25a5c..93a3231 100644 (file)
@@ -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);
index 799db7e..006be7e 100644 (file)
@@ -5,9 +5,7 @@
 
 #include <new>
 
-#ifdef __HONOR_STD
 using std::new_handler;
 using std::set_new_handler;
-#endif
 
 #endif // __NEW_H__
index 64b2a81..a735525 100644 (file)
@@ -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
index b208ca1..8daebbc 100644 (file)
@@ -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",
index 8ded741..36c5c74 100644 (file)
@@ -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;
                      }