[Bug c++/26693] [4.2/4.3/4.4 regression] Access checks not performed for types in templates

2009-03-28 Thread reichelt at gcc dot gnu dot org


--- Comment #11 from reichelt at gcc dot gnu dot org  2009-03-28 20:19 
---
 Shouldn't this be closed as fixed?

No, because the fix was reverted the bug remains unfixed.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26693



[Bug c++/26693] [4.2/4.3/4.4 regression] Access checks not performed for types in templates

2009-03-24 Thread howarth at nitro dot med dot uc dot edu


--- Comment #10 from howarth at nitro dot med dot uc dot edu  2009-03-24 
13:55 ---
Shouldn't this be closed as fixed?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26693



[Bug c++/26693] [4.2/4.3/4.4 regression] Access checks not performed for types in templates

2009-01-21 Thread dodji at gcc dot gnu dot org


--- Comment #8 from dodji at gcc dot gnu dot org  2009-01-21 16:15 ---
Subject: Bug 26693

Author: dodji
Date: Wed Jan 21 16:14:49 2009
New Revision: 143546

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=143546
Log:
gcc/ChangeLog:
2009-01-21  Dodji Seketeli  do...@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.
(is_typedef_decl ): New entry point.
* tree.h: Added a new member member_types_needing_access_check to
struct tree_decl_non_common.
(set_underlying_type): New entry point.
(is_typedef_type): Likewise.

gcc/cp/ChangeLog/
2009-01-21  Dodji Seketeli  do...@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.
* 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 ...
* pt.c (instantiate_class_template, instantiate_template ): ... access
checked at template instantiation time.
(tsubst): Handle the case of being called with NULL args.
(resolve_type_name_type): The type name should be the name of the
main type variant.
(append_type_to_template_for_access_check): New entry point.

gcc/testsuite/ChangeLog
2009-01-21  Dodji Seketeli  do...@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/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-01-21  Dodji Seketeli  do...@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++.


Added:
trunk/gcc/testsuite/g++.dg/template/typedef11.C
trunk/gcc/testsuite/g++.dg/template/typedef12.C
trunk/gcc/testsuite/g++.dg/template/typedef13.C
trunk/gcc/testsuite/g++.dg/template/typedef14.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-common.c
trunk/gcc/c-decl.c
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/decl.c
trunk/gcc/cp/decl2.c
trunk/gcc/cp/name-lookup.c
trunk/gcc/cp/pt.c
trunk/gcc/cp/semantics.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/template/access11.C
trunk/gcc/testsuite/g++.dg/template/sfinae3.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/typename8.C
trunk/gcc/tree.h
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/ext/bitmap_allocator.h


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26693



[Bug c++/26693] [4.2/4.3/4.4 regression] Access checks not performed for types in templates

2009-01-21 Thread dodji at gcc dot gnu dot org


--- Comment #9 from dodji at gcc dot gnu dot org  2009-01-22 07:15 ---
Subject: Bug 26693

Author: dodji
Date: Thu Jan 22 07:15:41 2009
New Revision: 143562

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=143562
Log:
Reverted commit 143546 related to PR c++/26693


Removed:
trunk/gcc/testsuite/g++.dg/template/typedef11.C
trunk/gcc/testsuite/g++.dg/template/typedef12.C
trunk/gcc/testsuite/g++.dg/template/typedef13.C
trunk/gcc/testsuite/g++.dg/template/typedef14.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-common.c
trunk/gcc/c-decl.c
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/decl.c
trunk/gcc/cp/decl2.c
trunk/gcc/cp/name-lookup.c
trunk/gcc/cp/pt.c
trunk/gcc/cp/semantics.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/template/access11.C
trunk/gcc/testsuite/g++.dg/template/sfinae3.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/typename8.C
trunk/gcc/tree.h
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/ext/bitmap_allocator.h


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26693



[Bug c++/26693] [4.2/4.3/4.4 regression] Access checks not performed for types in templates

2008-11-01 Thread dodji at gcc dot gnu dot org


--- Comment #7 from dodji at gcc dot gnu dot org  2008-11-01 14:29 ---
I posted a patch to http://gcc.gnu.org/ml/gcc-patches/2008-10/msg01278.html.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26693



[Bug c++/26693] [4.2/4.3/4.4 regression] Access checks not performed for types in templates

2008-10-29 Thread dodji at gcc dot gnu dot org


--- Comment #6 from dodji at gcc dot gnu dot org  2008-10-29 21:56 ---
I think the problem is due to the fact that in general, grokdeclarator() in
gcc/cp/decl.c does not properly set the type variant node for typedef
statements.

To understand this way of representing the relationship between a type and its
typedef names, please read the comment of function clone_underlying_type, in
gcc/c-decl.c.

So grokdeclarator() does not properly create the typedef type variant for the
typedef statement. Later, build_functional_cast in gcc/cp/typeck2.c looses the
information about the typedef. It just takes in account the initial type.

So later at templater instanciation time, there is no chance left to check the
access of the typedef name, as we only know about the initial type.

So in grokdeclarator() I think we should properly create the typedef type
variant for the typedef statement encountered during the parsing of a class
member.

Then later at template instanciation time we can have a chance to check for the
access of the typedef name as its information is still present via the typedef
type variant associated to the initial type.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26693



[Bug c++/26693] [4.2/4.3/4.4 regression] Access checks not performed for types in templates

2008-10-28 Thread dodji at gcc dot gnu dot org


-- 

dodji at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |dodji at gcc dot gnu dot org
   |dot org |
 Status|NEW |ASSIGNED
   Last reconfirmed|2007-09-01 20:49:21 |2008-10-28 12:16:16
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26693



[Bug c++/26693] [4.2/4.3/4.4 regression] Access checks not performed for types in templates

2008-08-21 Thread paolo dot carlini at oracle dot com


--- Comment #5 from paolo dot carlini at oracle dot com  2008-08-21 11:58 
---
*** Bug 36734 has been marked as a duplicate of this bug. ***


-- 

paolo dot carlini at oracle dot com changed:

   What|Removed |Added

 CC||m_albert137 at yahoo dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26693



[Bug c++/26693] [4.2/4.3/4.4 regression] Access checks not performed for types in templates

2008-07-04 Thread jsm28 at gcc dot gnu dot org


--- Comment #4 from jsm28 at gcc dot gnu dot org  2008-07-04 20:21 ---
Closing 4.1 branch.


-- 

jsm28 at gcc dot gnu dot org changed:

   What|Removed |Added

Summary|[4.1/4.2/4.3/4.4 regression]|[4.2/4.3/4.4 regression]
   |Access checks not performed |Access checks not performed
   |for types in templates  |for types in templates
   Target Milestone|4.1.3   |4.2.5


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26693