]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Reverted commit 143546 related to PR c++/26693
authorDodji Seketeli <dodji@redhat.com>
Thu, 22 Jan 2009 07:15:41 +0000 (07:15 +0000)
committerDodji Seketeli <dodji@gcc.gnu.org>
Thu, 22 Jan 2009 07:15:41 +0000 (08:15 +0100)
From-SVN: r143562

21 files changed:
gcc/ChangeLog
gcc/c-common.c
gcc/c-decl.c
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/decl2.c
gcc/cp/name-lookup.c
gcc/cp/pt.c
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/access11.C
gcc/testsuite/g++.dg/template/sfinae3.C
gcc/testsuite/g++.dg/template/typedef11.C [deleted file]
gcc/testsuite/g++.dg/template/typedef12.C [deleted file]
gcc/testsuite/g++.dg/template/typedef13.C [deleted file]
gcc/testsuite/g++.dg/template/typedef14.C [deleted file]
gcc/testsuite/g++.old-deja/g++.pt/typename8.C
gcc/tree.h
libstdc++-v3/ChangeLog
libstdc++-v3/include/ext/bitmap_allocator.h

index 74824ec9ebdf32b860ff4b1182f17b4ddeb2f174..d2e64ab3fd76de55d27b2d44afaef7078573cb46 100644 (file)
@@ -1,3 +1,13 @@
+2009-01-22  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/38930
+       * c-decl.c: (clone_underlying_type): Revert PR c++/26693 changes.
+       * c-common.c (set_underlying_type): Likewise.
+       (is_typedef_decl ): Likewise
+       * tree.h: Likewise
+       (set_underlying_type): Likewise.
+       (is_typedef_type): Likewise.
+
 2009-01-21  Vladimir Makarov  <vmakarov@redhat.com>
 
        PR middle-end/38587
index f398cf859e02699b87f2d7b6a6e1439576f04a04..5eed1dc89e1b5dda78afb85aa3d30569059aaa33 100644 (file)
@@ -8363,73 +8363,4 @@ warn_for_sign_compare (location_t location,
     }
 }
 
-/* Setup a TYPE_DECL node as a typedef representation.
-
-   X is a TYPE_DECL for a typedef statement.  Create a brand new
-   ..._TYPE node (which will be just a variant of the existing
-   ..._TYPE node with identical properties) and then install X
-   as the TYPE_NAME of this brand new (duplicate) ..._TYPE node.
-
-   The whole point here is to end up with a situation where each
-   and every ..._TYPE node the compiler creates will be uniquely
-   associated with AT MOST one node representing a typedef name.
-   This way, even though the compiler substitutes corresponding
-   ..._TYPE nodes for TYPE_DECL (i.e. "typedef name") nodes very
-   early on, later parts of the compiler can always do the reverse
-   translation and get back the corresponding typedef name.  For
-   example, given:
-
-       typedef struct S MY_TYPE;
-       MY_TYPE object;
-
-   Later parts of the compiler might only know that `object' was of
-   type `struct S' if it were not for code just below.  With this
-   code however, later parts of the compiler see something like:
-
-       struct S' == struct S
-       typedef struct S' MY_TYPE;
-       struct S' object;
-
-    And they can then deduce (from the node for type struct S') that
-    the original object declaration was:
-
-               MY_TYPE object;
-
-    Being able to do this is important for proper support of protoize,
-    and also for generating precise symbolic debugging information
-    which takes full account of the programmer's (typedef) vocabulary.
-
-    Obviously, we don't want to generate a duplicate ..._TYPE node if
-    the TYPE_DECL node that we are now processing really represents a
-    standard built-in type.  */
-
-void
-set_underlying_type (tree x)
-{
-  if (DECL_IS_BUILTIN (x))
-    {
-      if (TYPE_NAME (TREE_TYPE (x)) == 0)
-       TYPE_NAME (TREE_TYPE (x)) = x;
-    }
-  else if (TREE_TYPE (x) != error_mark_node
-          && DECL_ORIGINAL_TYPE (x) == NULL_TREE)
-    {
-      tree tt = TREE_TYPE (x);
-      DECL_ORIGINAL_TYPE (x) = tt;
-      tt = build_variant_type_copy (tt);
-      TYPE_STUB_DECL (tt) = TYPE_STUB_DECL (DECL_ORIGINAL_TYPE (x));
-      TYPE_NAME (tt) = x;
-      TREE_USED (tt) = TREE_USED (x);
-      TREE_TYPE (x) = tt;
-    }
-}
-
-/* Returns true if X is a typedef type.  */
-bool
-is_typedef_decl (tree x)
-{
-  return (x && TREE_CODE (x) == TYPE_DECL
-          && DECL_ORIGINAL_TYPE (x) != NULL_TREE);
-}
-
 #include "gt-c-common.h"
index 8b444d4177a31073bcec06685e034c862c2a1df0..7f7f2b00ac73c4538004b50280e7881c906b1b71 100644 (file)
@@ -1971,6 +1971,67 @@ warn_if_shadowing (tree new_decl)
       }
 }
 
+
+/* Subroutine of pushdecl.
+
+   X is a TYPE_DECL for a typedef statement.  Create a brand new
+   ..._TYPE node (which will be just a variant of the existing
+   ..._TYPE node with identical properties) and then install X
+   as the TYPE_NAME of this brand new (duplicate) ..._TYPE node.
+
+   The whole point here is to end up with a situation where each
+   and every ..._TYPE node the compiler creates will be uniquely
+   associated with AT MOST one node representing a typedef name.
+   This way, even though the compiler substitutes corresponding
+   ..._TYPE nodes for TYPE_DECL (i.e. "typedef name") nodes very
+   early on, later parts of the compiler can always do the reverse
+   translation and get back the corresponding typedef name.  For
+   example, given:
+
+       typedef struct S MY_TYPE;
+       MY_TYPE object;
+
+   Later parts of the compiler might only know that `object' was of
+   type `struct S' if it were not for code just below.  With this
+   code however, later parts of the compiler see something like:
+
+       struct S' == struct S
+       typedef struct S' MY_TYPE;
+       struct S' object;
+
+    And they can then deduce (from the node for type struct S') that
+    the original object declaration was:
+
+               MY_TYPE object;
+
+    Being able to do this is important for proper support of protoize,
+    and also for generating precise symbolic debugging information
+    which takes full account of the programmer's (typedef) vocabulary.
+
+    Obviously, we don't want to generate a duplicate ..._TYPE node if
+    the TYPE_DECL node that we are now processing really represents a
+    standard built-in type.  */
+
+static void
+clone_underlying_type (tree x)
+{
+  if (DECL_IS_BUILTIN (x))
+    {
+      if (TYPE_NAME (TREE_TYPE (x)) == 0)
+       TYPE_NAME (TREE_TYPE (x)) = x;
+    }
+  else if (TREE_TYPE (x) != error_mark_node
+          && DECL_ORIGINAL_TYPE (x) == NULL_TREE)
+    {
+      tree tt = TREE_TYPE (x);
+      DECL_ORIGINAL_TYPE (x) = tt;
+      tt = build_variant_type_copy (tt);
+      TYPE_NAME (tt) = x;
+      TREE_USED (tt) = TREE_USED (x);
+      TREE_TYPE (x) = tt;
+    }
+}
+
 /* Record a decl-node X as belonging to the current lexical scope.
    Check for errors (such as an incompatible declaration for the same
    name already seen in the same scope).
@@ -2193,7 +2254,7 @@ pushdecl (tree x)
 
  skip_external_and_shadow_checks:
   if (TREE_CODE (x) == TYPE_DECL)
-    set_underlying_type (x);
+    clone_underlying_type (x);
 
   bind (name, x, scope, /*invisible=*/false, nested);
 
index b2ca4cf3ec2e3440018dc28c2c4cad3e9bb3b847..a7d18d22fb64d7c1d3b5b8b8241d070b5c4acc98 100644 (file)
@@ -1,3 +1,18 @@
+2009-01-22  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/38930
+       * decl2.c (grokfield): Reverting changes of PR c++/26693
+       (save_template_attributes): Likewise.
+       * decl.c (grokdeclarator): Likewise.
+       * name-lookup.c (pushdecl_maybe_friend): Likewise.
+       * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Likewise.
+       (append_type_to_template_for_access_check): Likewise.
+       * semantics.c (check_accessibility_of_qualified_id): Likewise.
+       * pt.c (instantiate_class_template, instantiate_template ): Likewise.
+       (tsubst): Likewise.
+       (resolve_type_name_type): Likewise.
+       (append_type_to_template_for_access_check): Likewise.
+
 2009-01-21  Dodji Seketeli  <dodji@redhat.com>
 
        PR c++/26693
index b740700e1838de646f5162b52ce9ef9a675d9d55..186ec9ab6adffef6a615d8ba42cd3bc9b79e28c5 100644 (file)
@@ -3179,14 +3179,6 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
    && TREE_CODE (DECL_TEMPLATE_RESULT (NODE)) == TYPE_DECL \
    && !DECL_TEMPLATE_TEMPLATE_PARM_P (NODE))
 
-/* The chained list of some types that are referenced in templates.
-   These types are those which need to be access checked at
-   template instantiation time.  For the time being, only typedef-ed types defined
-   as class members are put here at parsing time.
-   Other types for which access check could be required at template instantiation
-   time could be added later.  */
-#define MEMBER_TYPES_NEEDING_ACCESS_CHECK(NODE) DECL_ACCESS (NODE)
-
 /* Nonzero if NODE which declares a type.  */
 #define DECL_DECLARES_TYPE_P(NODE) \
   (TREE_CODE (NODE) == TYPE_DECL || DECL_CLASS_TEMPLATE_P (NODE))
@@ -4547,7 +4539,6 @@ extern tree check_explicit_specialization (tree, tree, int, int);
 extern tree make_auto                          (void);
 extern tree do_auto_deduction                  (tree, tree, tree);
 extern tree type_uses_auto                     (tree);
-extern void append_type_to_template_for_access_check (tree, tree, tree);
 extern tree splice_late_return_type            (tree, tree);
 extern bool is_auto                            (const_tree);
 extern tree process_template_parm              (tree, tree, bool, bool);
index 2163e397cd2950a2d360448b1d0b12f5abfe1cfd..8476959bff44976f44ae31428d85c229d6b0560d 100644 (file)
@@ -8729,7 +8729,6 @@ grokdeclarator (const cp_declarator *declarator,
        decl = build_lang_decl (TYPE_DECL, unqualified_id, type);
       else
        decl = build_decl (TYPE_DECL, unqualified_id, type);
-
       if (id_declarator && declarator->u.id.qualifying_scope) {
        error ("%Jtypedef name may not be a nested-name-specifier", decl);
        TREE_TYPE (decl) = error_mark_node;
@@ -8764,11 +8763,12 @@ grokdeclarator (const cp_declarator *declarator,
          && TYPE_ANONYMOUS_P (type)
          && cp_type_quals (type) == TYPE_UNQUALIFIED)
        {
+         tree oldname = TYPE_NAME (type);
          tree t;
 
          /* Replace the anonymous name with the real name everywhere.  */
          for (t = TYPE_MAIN_VARIANT (type); t; t = TYPE_NEXT_VARIANT (t))
-           if (ANON_AGGRNAME_P (TYPE_IDENTIFIER (t)))
+           if (TYPE_NAME (t) == oldname)
              TYPE_NAME (t) = decl;
 
          if (TYPE_LANG_SPECIFIC (type))
index 22192a001baf0338ddf2a1237800ac49554cd25f..c8887257ece17cef31d57886738c18b01237eead 100644 (file)
@@ -804,9 +804,6 @@ grokfield (const cp_declarator *declarator,
       DECL_NONLOCAL (value) = 1;
       DECL_CONTEXT (value) = current_class_type;
 
-      if (declspecs->specs[(int)ds_typedef])
-       set_underlying_type (value);
-
       if (processing_template_decl)
        value = push_template_decl (value);
 
@@ -1128,6 +1125,19 @@ save_template_attributes (tree *attr_p, tree *decl_p)
   if (!late_attrs)
     return;
 
+  /* Give this type a name so we know to look it up again at instantiation
+     time.  */
+  if (TREE_CODE (*decl_p) == TYPE_DECL
+      && DECL_ORIGINAL_TYPE (*decl_p) == NULL_TREE)
+    {
+      tree oldt = TREE_TYPE (*decl_p);
+      tree newt = build_variant_type_copy (oldt);
+      DECL_ORIGINAL_TYPE (*decl_p) = oldt;
+      TREE_TYPE (*decl_p) = newt;
+      TYPE_NAME (newt) = *decl_p;
+      TREE_USED (newt) = TREE_USED (*decl_p);
+    }
+
   if (DECL_P (*decl_p))
     q = &DECL_ATTRIBUTES (*decl_p);
   else
index 2c69cfe68a6f972385c23f2a31b99d6b448f4a2e..f8d0204f0994bc22463c4306abc3803f4ef58557 100644 (file)
@@ -847,20 +847,28 @@ pushdecl_maybe_friend (tree x, bool is_friend)
 
       /* If declaring a type as a typedef, copy the type (unless we're
         at line 0), and install this TYPE_DECL as the new type's typedef
-        name.  See the extensive comment of set_underlying_type ().  */
+        name.  See the extensive comment in ../c-decl.c (pushdecl).  */
       if (TREE_CODE (x) == TYPE_DECL)
        {
          tree type = TREE_TYPE (x);
-
-         if (DECL_IS_BUILTIN (x)
-             || (TREE_TYPE (x) != error_mark_node
-                 && TYPE_NAME (type) != x
-                 /* We don't want to copy the type when all we're
-                    doing is making a TYPE_DECL for the purposes of
-                    inlining.  */
-                 && (!TYPE_NAME (type)
-                     || TYPE_NAME (type) != DECL_ABSTRACT_ORIGIN (x))))
-           set_underlying_type (x);
+         if (DECL_IS_BUILTIN (x))
+           {
+             if (TYPE_NAME (type) == 0)
+               TYPE_NAME (type) = x;
+           }
+         else if (type != error_mark_node && TYPE_NAME (type) != x
+                  /* We don't want to copy the type when all we're
+                     doing is making a TYPE_DECL for the purposes of
+                     inlining.  */
+                  && (!TYPE_NAME (type)
+                      || TYPE_NAME (type) != DECL_ABSTRACT_ORIGIN (x)))
+           {
+             DECL_ORIGINAL_TYPE (x) = type;
+             type = build_variant_type_copy (type);
+             TYPE_STUB_DECL (type) = TYPE_STUB_DECL (DECL_ORIGINAL_TYPE (x));
+             TYPE_NAME (type) = x;
+             TREE_TYPE (x) = type;
+           }
 
          if (type != error_mark_node
              && TYPE_NAME (type)
index 36edb449e009c6ae0d15a31d180e980ec4bf5c36..f6809f2bdf7db53d78b412e66acde646c8f4042a 100644 (file)
@@ -7387,31 +7387,6 @@ instantiate_class_template (tree type)
          && DECL_TEMPLATE_INFO (t))
        tsubst_default_arguments (t);
 
-  /* Some types referenced from within the template code need to be access
-     checked at template instantiation time, i.e now. These types were
-     added to the template at parsing time. Let's get those and perfom
-     the acces checks then.  */
-  for (t = MEMBER_TYPES_NEEDING_ACCESS_CHECK (templ); t; t = TREE_CHAIN (t))
-    {
-      tree type_decl = TREE_PURPOSE (t);
-      tree type_scope = TREE_VALUE (t);
-
-      if (!type_decl || !type_scope || !CLASS_TYPE_P (type_scope))
-       continue;
-
-      if (uses_template_parms (type_decl))
-       type_decl = tsubst (type_decl, args, tf_error, NULL_TREE);
-
-      if (uses_template_parms (type_scope))
-       type_scope = tsubst (type_scope, args, tf_error, NULL_TREE);
-
-      gcc_assert (type_decl && type_decl != error_mark_node
-                 && type_scope && type_scope != error_mark_node);
-
-      perform_or_defer_access_check (TYPE_BINFO (type_scope), type_decl, type_decl);
-    }
-
-  perform_deferred_access_checks ();
   pop_nested_class ();
   pop_from_top_level ();
   pop_deferring_access_checks ();
@@ -11894,7 +11869,6 @@ instantiate_template (tree tmpl, tree targ_ptr, tsubst_flags_t complain)
   tree fndecl;
   tree gen_tmpl;
   tree spec;
-  tree t;
   HOST_WIDE_INT saved_processing_template_decl;
 
   if (tmpl == error_mark_node)
@@ -11973,24 +11947,6 @@ instantiate_template (tree tmpl, tree targ_ptr, tsubst_flags_t complain)
   /* Now we know the specialization, compute access previously
      deferred.  */
   push_access_scope (fndecl);
-
-  /* Some types referenced from within the template code need to be access
-     checked at template instantiation time, i.e now. These types were
-     added to the template at parsing time. Let's get those and perfom
-     the acces checks then.  */
-  for (t = MEMBER_TYPES_NEEDING_ACCESS_CHECK (tmpl); t; t = TREE_CHAIN (t))
-    {
-      tree type_decl = TREE_PURPOSE (t);
-      tree type_scope = TREE_VALUE (t);
-
-      if (!type_decl || !type_scope || !CLASS_TYPE_P (type_scope))
-       continue;
-
-      if (uses_template_parms (type_decl))
-       type_decl = tsubst (type_decl, targ_ptr, tf_error, NULL_TREE);
-
-      perform_or_defer_access_check (TYPE_BINFO (type_scope), type_decl, type_decl);
-    }
   perform_deferred_access_checks ();
   pop_access_scope (fndecl);
   pop_deferring_access_checks ();
@@ -16677,15 +16633,7 @@ resolve_typename_type (tree type, bool only_current_p)
   gcc_assert (TREE_CODE (type) == TYPENAME_TYPE);
 
   scope = TYPE_CONTEXT (type);
-  /* Usually the non-qualified identifier of a TYPENAME_TYPE is
-     TYPE_IDENTIFIER (type). But when 'type' is a typedef variant of
-     a TYPENAME_TYPE node, then TYPE_NAME (type) is set to the TYPE_DECL representing
-     the typedef. In that case TYPE_IDENTIFIER (type) is not the non-qualified
-     identifier  of the TYPENAME_TYPE anymore.
-     So by getting the TYPE_IDENTIFIER of the _main declaration_ of the
-     TYPENAME_TYPE instead, we avoid messing up with a possible
-     typedef variant case.  */
-  name = TYPE_IDENTIFIER (TYPE_MAIN_VARIANT (type));
+  name = TYPE_IDENTIFIER (type);
 
   /* If the SCOPE is itself a TYPENAME_TYPE, then we need to resolve
      it first before we can figure out what NAME refers to.  */
@@ -17010,45 +16958,4 @@ type_uses_auto (tree type)
   return NULL_TREE;
 }
 
-/* Append TYPE_DECL to the template TMPL.
-   TMPL is eiter a class type or a FUNCTION_DECL associated
-   to a TEMPLATE_DECL.
-   At TMPL instanciation time, TYPE_DECL will be checked to see
-   if it can be accessed through SCOPE.  */
-void
-append_type_to_template_for_access_check (tree templ,
-                                          tree type_decl,
-                                         tree scope)
-{
-  tree node, templ_decl;
-
-  gcc_assert (templ
-             && get_template_info (templ)
-             && TI_TEMPLATE (get_template_info (templ))
-             && type_decl
-             && (TREE_CODE (type_decl) == TYPE_DECL));
-
-  templ_decl = TI_TEMPLATE (get_template_info (templ));
-  gcc_assert (templ_decl);
-
-  /* Make sure we don't append the type to the template twice.
-     If this appears to be too slow, the
-     MEMBER_TYPE_NEEDING_ACCESS_CHECK property
-     of templ should be a hash table instead.  */
-  for (node = MEMBER_TYPES_NEEDING_ACCESS_CHECK (templ_decl);
-       node;
-       node = TREE_CHAIN (node))
-    {
-      tree decl = TREE_PURPOSE (node);
-      tree type_scope = TREE_VALUE (node);
-
-      if (decl == type_decl && type_scope == scope)
-       return;
-    }
-
-  MEMBER_TYPES_NEEDING_ACCESS_CHECK (templ_decl) =
-    tree_cons (type_decl, scope,
-              MEMBER_TYPES_NEEDING_ACCESS_CHECK (templ_decl));
-}
-
 #include "gt-cp-pt.h"
index 528a0c5de85c894514cebef9c991b25406ed6e68..c9f0641f5f8452ace0325ee8ca6613f3cfbb2009 100644 (file)
@@ -1529,30 +1529,6 @@ check_accessibility_of_qualified_id (tree decl,
   tree scope;
   tree qualifying_type = NULL_TREE;
 
-  /* If we are parsing a template declaration and if decl is a typedef,
-     add it to a list tied to the template.
-     At template instantiation time, that list will be walked and
-     access check performed.  */
-  if (is_typedef_decl (decl))
-    {
-      /* This the scope through which type_decl is accessed.
-        It will be useful information later to do access check for
-        type_decl usage.  */
-      tree scope = nested_name_specifier ? nested_name_specifier : DECL_CONTEXT (decl);
-      tree templ_info = NULL;
-      tree cs = current_scope ();
-
-      if (cs && (CLASS_TYPE_P (cs) || TREE_CODE (cs) == FUNCTION_DECL))
-       templ_info = get_template_info (cs);
-
-      if (templ_info
-         && TI_TEMPLATE (templ_info)
-         && scope
-         && CLASS_TYPE_P (scope)
-         && !currently_open_class (scope))
-       append_type_to_template_for_access_check (current_scope (), decl, scope);
-    }
-
   /* If we're not checking, return immediately.  */
   if (deferred_access_no_check)
     return;
index 70ae0d77dcc5ce86d2a87309cac9d9111391ff0f..df530ddb93f4faffca23ba70f4ec8d09371752a0 100644 (file)
@@ -1,3 +1,14 @@
+2009-01-22  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/38930
+       * g++.dg/template/typedef11.C: Reverting changes of PR c++/26693.
+       * g++.dg/template/typedef12.C: Likewise.
+       * g++.dg/template/typedef13.C: Likewise.
+       * g++.dg/template/typedef14.C: Likewise.
+       * g++.dg/template/sfinae3.C: Likewise.
+       * g++.old-deja/g++.pt/typename8.C: Likewise.
+       * g++.dg/template/access11.C: Likewise
+
 2009-01-21  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * gcc.dg/tree-ssa/ssa-store-ccp-3.c: Skip for mips*-*-linux*
index 38bd5155f65b81126d639d9779b1241c9f013f21..4c8dce521a894a35da7b473dd34a9fe00a6982a6 100644 (file)
@@ -17,8 +17,8 @@ template <> struct X::Y<int> {
   A::X x;                      // { dg-error "this context" }
 };
 
-template <typename T> struct X::Y { // { dg-error "this context" }
+template <typename T> struct X::Y {
   typename T::X x;             // { dg-error "this context" }
 };
 
-template struct X::Y<A>;       // { dg-message "instantiated from here" }
+template struct X::Y<A>;       // { dg-message "instantiated" }
index 349463d95fe3680f893bbbdd704148cfc69f4588..5799a364e4253d74c77a7fd3a58fbb9bd9ab54c0 100644 (file)
@@ -1,5 +1,5 @@
 // PR c++/24671
-// { dg-do compile }
+// { dg-options "" }
 
 template<typename> struct A
 {
@@ -9,9 +9,9 @@ template<typename> struct A
 
 template<typename> struct B
 {
-  B(const B&);
-  typedef typename A<char[A<B>::i]>::X Y; // { dg-error "forbids zero-size array" }
-  template<typename T> B(T, Y);
+  B(const B&); // { dg-message "candidate" }
+  typedef typename A<char[A<B>::i]>::X Y;
+  template<typename T> B(T, Y); // { dg-error "call" }
 };
 
-B<int> b(0,0); // { dg-message "instantiated from here" }
+B<int> b(0,0); 
diff --git a/gcc/testsuite/g++.dg/template/typedef11.C b/gcc/testsuite/g++.dg/template/typedef11.C
deleted file mode 100644 (file)
index c7c7c98..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-// Author: Dodji Seketeli <dodji@redhat.com>
-// Origin: PR c++/26693
-// { dg-do compile }
-
-
-class Alpha
-{
-  typedef int X; // { dg-error "'typedef int Alpha::X' is private" }
-};
-
-template<int>
-class Beta
-{
-    typedef int Y; // { dg-error "'typedef int Beta<0>::Y' is private" }
-};
-
-template <int>
-int
-bar ()
-{
-  Beta<0>::Y i = 0;
-  return Alpha::X ();
-}
-
-int i = bar<0> (); // { dg-error "within this context" }
diff --git a/gcc/testsuite/g++.dg/template/typedef12.C b/gcc/testsuite/g++.dg/template/typedef12.C
deleted file mode 100644 (file)
index 3060504..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// Contributed by Dodji Seketeli <dodji@redhat.com>
-// Origin: Jason Merrill <jason@redhat.com>, PR c++/26693
-// { dg-do compile }
-
-class A
-{
-     protected:
-           typedef int mytype;
-};
-
-template <class T> class B;
-
-class C: public A
-{
-      template <class T> friend class B;
-};
-
-template <class T> class B
-{
-      C::mytype mem;
-};
-
-B<int> b;
diff --git a/gcc/testsuite/g++.dg/template/typedef13.C b/gcc/testsuite/g++.dg/template/typedef13.C
deleted file mode 100644 (file)
index aa8bb32..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-// Contributed by Dodji Seketeli <dodji@redhat.com>
-// Origin: PR c++/26693
-// { dg-do compile }
-
-class A
-{
-  typedef int mytype; // { dg-error "typedef int A::mytype' is private" }
-};
-
-template <class T> class B : public A
-{ // { dg-error "within this context"  }
-  mytype mem;
-};
-
-B<int> b; // { dg-message "instantiated from here" }
-
diff --git a/gcc/testsuite/g++.dg/template/typedef14.C b/gcc/testsuite/g++.dg/template/typedef14.C
deleted file mode 100644 (file)
index caa565a..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-// Contributed by Dodji Seketeli <dodji@redhat.com>
-// Origin: PR c++/26693
-// { dg-do compile }
-
-template <class T>
-struct A
-{
-  typedef int mytype;
-
-  void
-  foo ()
-  {
-    mytype v = ~static_cast<mytype> (0);
-  }
-};
-
index 4861cf301ed38b5d18bf635a7a95f2c1559bb0c4..6eb818b394728c3fe1115eecf945fb94908b31c8 100644 (file)
@@ -5,14 +5,14 @@ template < class T > class A
 public:
   typedef typename T::myT anotherT; // { dg-error "" } undefined type
 
-  anotherT t;
+  anotherT t; // { dg-error "" } undefined type 
 
   A() { }
-  A(anotherT _t) {
+  A(anotherT _t) { // { dg-error "" } undefined type
     t=_t;
   }
 
-  anotherT getT() {
+  anotherT getT() { // { dg-error "" } undefined type
     return t;
   }
 };
index f7ff2e6d92b3fb39096c0e3f5f95b79d2b36c55d..55163b6c1b7a5b7a0ca8e4eb015ef9a296a26f95 100644 (file)
@@ -3412,9 +3412,6 @@ struct tree_target_option GTY(())
 /* Return a tree node that encapsulates the current target options.  */
 extern tree build_target_option_node (void);
 
-extern void set_underlying_type (tree x);
-
-extern bool is_typedef_decl (tree x);
 \f
 /* Define the overall contents of a tree node.
    It may be any of the structures declared above
index 2f4021c800b4feba52cfbefc3fa8a5fbc04c7911..e103b8851f43ce72488b5e4dd4cfa054cff6d286 100644 (file)
@@ -1,3 +1,8 @@
+2009-01-22  Dodji Seketeli  <dodji@redhat.com>
+
+       * include/ext/bitmap_allocator.h: Reverting changes related to PR
+       c++/26693.
+
 2009-01-21  Benjamin Kosnik  <bkoz@redhat.com>
 
        * testsuite/29_atomics/headers/stdatomic.h/functions.c: Remove
index 7768bd2396db5a3152cce89cf7a232239e132546..7f5466afe188c7ae3c48894ffef78a34571c5b3e 100644 (file)
@@ -549,13 +549,11 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
    */
   class free_list
   {
-  public:
     typedef size_t*                            value_type;
     typedef __detail::__mini_vector<value_type> vector_type;
     typedef vector_type::iterator              iterator;
     typedef __mutex                            __mutex_type;
 
-  private:
     struct _LT_pointer_compare
     {
       bool