gcc/libstdc++-v3/include/ext
Dodji Seketeli d0940d5662 re PR c++/26693 (Access checks not performed for types in templates)
gcc/ChangeLog:
2009-04-02  Dodji Seketeli  <dodji@redhat.com>

    PR c++/26693
    * c-decl.c: (clone_underlying_type): Move this ...
    * c-common.c (set_underlying_type): ... here.
    Also, make sure the function properly sets TYPE_STUB_DECL() on
    the newly created typedef variant type.
    * c-common.h (is_typedef_decl, set_underlying_type): Declare ...
    * c-common.c (is_typedef_decl, set_underlying_type): ... new entry points.

gcc/cp/ChangeLog:
2009-04-02  Dodji Seketeli  <dodji@redhat.com>

    PR c++/26693
    * decl2.c (grokfield): when a typedef appears in a
    class, create the typedef variant type node for it.
    (save_template_attributes): Creating typedef variant type node
     here is now useless.
    * decl.c (grokdeclarator): If the typedef'ed struct/class was
    anonymous, set the proper type name to all its type variants.
    (xref_basetypes) : Fixup the variant types after setting
    TYPE_BINFO on REF.
    * name-lookup.c (pushdecl_maybe_friend): Reuse the
    set_underlying_type function to install typedef variant types.
    * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
    macro.
    (append_type_to_template_for_access_check): New entry points.
    * semantics.c (check_accessibility_of_qualified_id):
    When a typedef that is a member of a class appears in a template,
    add it to the template. It will be ...
    * class.c (finish_struct_bits): Split type variant fixup into ...
    (fixup_type_variants): A new entry point.
    * pt.c (instantiate_class_template, instantiate_template ): ... access
    checked at template instantiation time.
    (resolve_type_name_type): The type name should be the name of the
    main type variant.
    (retrieve_specialization): Specializations of template typedefs aren't
    to be looked up in DECL_TEMPLATE_INSTANTIATIONS (tmpl).
    (append_type_to_template_for_access_check): New entry point.
    (tsubst_decl): For typedefs, build the variant type from the correct
    original type.
    (get_class_bindings): Fix function comment.
    (perform_typedefs_access_check): New entry point.

gcc/testsuite/ChangeLog:
2009-04-02  Dodji Seketeli  <dodji@redhat.com>

    PR c++/26693
    * g++.dg/template/typedef11.C: New test.
    * g++.dg/template/typedef12.C: Likewise.
    * g++.dg/template/typedef13.C: Likewise.
    * g++.dg/template/typedef14.C: Likewise.
    * g++.dg/template/typedef15.C: Likewise.
    * g++.dg/template/typedef16.C: Likewise.
    * g++.dg/template/sfinae3.C: Compile this pedantically.
    The only errors expected should be the one saying the typedef is ill
    formed.
    * g++.old-deja/g++.pt/typename8.C: Likewise.
    * g++.dg/template/access11.C: Update this.

libstdc++-v3/ChangeLog:
2009-04-02  Dodji Seketeli  <dodji@redhat.com>

    * include/ext/bitmap_allocator.h: the typedefs should be made public
    if we want them to be accessible. This has been revealed by the patch
    that fixes PR c++/26693 in g++.

From-SVN: r145440
2009-04-02 11:24:19 +02:00
..
pb_ds re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 23:44:53 +00:00
algorithm stl_numeric.h (iota): Add in C++0x mode. 2008-06-27 10:47:27 +00:00
array_allocator.h user.cfg.in: Tweaks. 2009-02-21 00:45:21 +00:00
atomicity.h acinclude.m4 (GLIBCXX_ENABLE_ATOMIC_BUILTINS): Check for set of all used __sync builtins, in two sizes. 2008-04-24 14:40:29 +00:00
bitmap_allocator.h re PR c++/26693 (Access checks not performed for types in templates) 2009-04-02 11:24:19 +02:00
cast.h extptr_allocator.h: Minor tweaks. 2008-11-11 12:15:59 +00:00
codecvt_specializations.h run_doxygen: Remove html_output_dir. 2008-03-26 06:27:35 +00:00
concurrence.h concurrence.h: Fix __gthread_cond_t initialisation function macro name. 2008-12-23 03:10:35 +00:00
debug_allocator.h user.cfg.in: Tweaks. 2009-02-21 00:45:21 +00:00
enc_filebuf.h run_doxygen: Remove html_output_dir. 2008-03-26 06:27:35 +00:00
extptr_allocator.h user.cfg.in: Tweaks. 2009-02-21 00:45:21 +00:00
functional PR libstdc++/28080 (partial) 2007-02-26 09:36:39 +00:00
iterator
malloc_allocator.h user.cfg.in: Tweaks. 2009-02-21 00:45:21 +00:00
memory re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 23:44:53 +00:00
mt_allocator.h user.cfg.in: Tweaks. 2009-02-21 00:45:21 +00:00
new_allocator.h user.cfg.in: Tweaks. 2009-02-21 00:45:21 +00:00
numeric
numeric_traits.h stl_algobase.h (struct __lexicographical_compare): Add. 2007-11-16 23:41:55 +00:00
pod_char_traits.h pod_char_traits.h (char_traits<>::move): Use __builtin_memmove. 2007-05-11 18:58:08 +00:00
pointer.h re PR libstdc++/38720 (_Relative_pointer_impl invokes undefined behavior) 2009-01-04 19:51:18 +00:00
pool_allocator.h user.cfg.in: Tweaks. 2009-02-21 00:45:21 +00:00
rb_tree
rc_string_base.h re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 23:44:53 +00:00
rope re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 23:44:53 +00:00
ropeimpl.h re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 23:44:53 +00:00
slist re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 23:44:53 +00:00
sso_string_base.h re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 23:44:53 +00:00
stdio_filebuf.h
stdio_sync_filebuf.h run_doxygen: Remove html_output_dir. 2008-03-26 06:27:35 +00:00
string_conversions.h string_conversions.cc: Remove. 2008-06-29 15:46:50 +00:00
throw_allocator.h user.cfg.in: Tweaks. 2009-02-21 00:45:21 +00:00
type_traits.h re PR libstdc++/31426 (TR1 includes do not work with -std=c++0x) 2007-05-31 23:37:56 +00:00
typelist.h [multiple changes] 2008-04-10 20:26:45 +00:00
vstring.h iostream: Fix doxygen link. 2009-03-11 15:16:21 +00:00
vstring.tcc re PR libstdc++/25191 (exception_defines.h #defines try/catch) 2009-02-03 23:44:53 +00:00
vstring_fwd.h PR libstdc++/33979 (partial) 2008-08-20 19:29:54 +00:00
vstring_util.h [multiple changes] 2008-06-21 16:55:17 +00:00