public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/26693]  New: [4.0/4.1/4.2 regression] Access checks not performed for types in templates
@ 2006-03-15 13:20 reichelt at gcc dot gnu dot org
  2006-03-15 13:24 ` [Bug c++/26693] " pinskia at gcc dot gnu dot org
                   ` (21 more replies)
  0 siblings, 22 replies; 23+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-03-15 13:20 UTC (permalink / raw)
  To: gcc-bugs

The following invalid code is accepted since GCC 3.4.0:

================================================
class A
{
  private:
    typedef int X;
};

template<int> int foo() { return A::X(); } // A::X is private!

int i=foo<0>();
================================================

If I make foo a non-template function, the code is correctly rejected.


-- 
           Summary: [4.0/4.1/4.2 regression] Access checks not performed for
                    types in templates
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid, monitored
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/26693] [4.0/4.1/4.2 regression] Access checks not performed for types in templates
  2006-03-15 13:20 [Bug c++/26693] New: [4.0/4.1/4.2 regression] Access checks not performed for types in templates reichelt at gcc dot gnu dot org
@ 2006-03-15 13:24 ` pinskia at gcc dot gnu dot org
  2006-06-04 18:06 ` mmitchel at gcc dot gnu dot org
                   ` (20 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-15 13:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-03-15 13:24 -------
Confirmed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
      Known to fail|                            |3.4.0 4.0.0 4.1.0 4.2.0
      Known to work|                            |3.3.3
   Last reconfirmed|0000-00-00 00:00:00         |2006-03-15 13:24:24
               date|                            |
   Target Milestone|---                         |4.0.4


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/26693] [4.0/4.1/4.2 regression] Access checks not performed for types in templates
  2006-03-15 13:20 [Bug c++/26693] New: [4.0/4.1/4.2 regression] Access checks not performed for types in templates reichelt at gcc dot gnu dot org
  2006-03-15 13:24 ` [Bug c++/26693] " pinskia at gcc dot gnu dot org
@ 2006-06-04 18:06 ` mmitchel at gcc dot gnu dot org
  2006-09-07  7:18 ` jason at gcc dot gnu dot org
                   ` (19 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-06-04 18:06 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/26693] [4.0/4.1/4.2 regression] Access checks not performed for types in templates
  2006-03-15 13:20 [Bug c++/26693] New: [4.0/4.1/4.2 regression] Access checks not performed for types in templates reichelt at gcc dot gnu dot org
  2006-03-15 13:24 ` [Bug c++/26693] " pinskia at gcc dot gnu dot org
  2006-06-04 18:06 ` mmitchel at gcc dot gnu dot org
@ 2006-09-07  7:18 ` jason at gcc dot gnu dot org
  2007-02-03 16:24 ` [Bug c++/26693] [4.0/4.1/4.2/4.3 " gdr at gcc dot gnu dot org
                   ` (18 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: jason at gcc dot gnu dot org @ 2006-09-07  7:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jason at gcc dot gnu dot org  2006-09-07 07:18 -------
If we resolve A::X to int while parsing the template definition, we need to
check access then, too.


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/26693] [4.0/4.1/4.2/4.3 regression] Access checks not performed for types in templates
  2006-03-15 13:20 [Bug c++/26693] New: [4.0/4.1/4.2 regression] Access checks not performed for types in templates reichelt at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2006-09-07  7:18 ` jason at gcc dot gnu dot org
@ 2007-02-03 16:24 ` gdr at gcc dot gnu dot org
  2007-02-03 17:27 ` jsm28 at gcc dot gnu dot org
                   ` (17 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: gdr at gcc dot gnu dot org @ 2007-02-03 16:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from gdr at gcc dot gnu dot org  2007-02-03 16:24 -------
Won't fix in GCC-4.0.x.  Adjustine milestone.


-- 

gdr at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.4                       |---


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/26693] [4.0/4.1/4.2/4.3 regression] Access checks not performed for types in templates
  2006-03-15 13:20 [Bug c++/26693] New: [4.0/4.1/4.2 regression] Access checks not performed for types in templates reichelt at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2007-02-03 16:24 ` [Bug c++/26693] [4.0/4.1/4.2/4.3 " gdr at gcc dot gnu dot org
@ 2007-02-03 17:27 ` jsm28 at gcc dot gnu dot org
  2007-02-14  9:10 ` mmitchel at gcc dot gnu dot org
                   ` (16 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2007-02-03 17:27 UTC (permalink / raw)
  To: gcc-bugs



-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.1.2


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/26693] [4.0/4.1/4.2/4.3 regression] Access checks not performed for types in templates
  2006-03-15 13:20 [Bug c++/26693] New: [4.0/4.1/4.2 regression] Access checks not performed for types in templates reichelt at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2007-02-03 17:27 ` jsm28 at gcc dot gnu dot org
@ 2007-02-14  9:10 ` mmitchel at gcc dot gnu dot org
  2008-07-04 20:22 ` [Bug c++/26693] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
                   ` (15 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-02-14  9:10 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.1.2                       |4.1.3


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/26693] [4.2/4.3/4.4 regression] Access checks not performed for types in templates
  2006-03-15 13:20 [Bug c++/26693] New: [4.0/4.1/4.2 regression] Access checks not performed for types in templates reichelt at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2007-02-14  9:10 ` mmitchel at gcc dot gnu dot org
@ 2008-07-04 20:22 ` jsm28 at gcc dot gnu dot org
  2008-08-21 11:59 ` paolo dot carlini at oracle dot com
                   ` (14 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-07-04 20:22 UTC (permalink / raw)
  To: gcc-bugs



------- 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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/26693] [4.2/4.3/4.4 regression] Access checks not performed for types in templates
  2006-03-15 13:20 [Bug c++/26693] New: [4.0/4.1/4.2 regression] Access checks not performed for types in templates reichelt at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2008-07-04 20:22 ` [Bug c++/26693] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
@ 2008-08-21 11:59 ` paolo dot carlini at oracle dot com
  2008-10-28 12:17 ` dodji at gcc dot gnu dot org
                   ` (13 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: paolo dot carlini at oracle dot com @ 2008-08-21 11:59 UTC (permalink / raw)
  To: gcc-bugs



------- 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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/26693] [4.2/4.3/4.4 regression] Access checks not performed for types in templates
  2006-03-15 13:20 [Bug c++/26693] New: [4.0/4.1/4.2 regression] Access checks not performed for types in templates reichelt at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2008-08-21 11:59 ` paolo dot carlini at oracle dot com
@ 2008-10-28 12:17 ` dodji at gcc dot gnu dot org
  2008-10-29 21:56 ` dodji at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: dodji at gcc dot gnu dot org @ 2008-10-28 12:17 UTC (permalink / raw)
  To: gcc-bugs



-- 

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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/26693] [4.2/4.3/4.4 regression] Access checks not performed for types in templates
  2006-03-15 13:20 [Bug c++/26693] New: [4.0/4.1/4.2 regression] Access checks not performed for types in templates reichelt at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2008-10-28 12:17 ` dodji at gcc dot gnu dot org
@ 2008-10-29 21:56 ` dodji at gcc dot gnu dot org
  2008-11-01 14:31 ` dodji at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: dodji at gcc dot gnu dot org @ 2008-10-29 21:56 UTC (permalink / raw)
  To: gcc-bugs



------- 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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/26693] [4.2/4.3/4.4 regression] Access checks not performed for types in templates
  2006-03-15 13:20 [Bug c++/26693] New: [4.0/4.1/4.2 regression] Access checks not performed for types in templates reichelt at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2008-10-29 21:56 ` dodji at gcc dot gnu dot org
@ 2008-11-01 14:31 ` dodji at gcc dot gnu dot org
  2009-01-21 16:15 ` dodji at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: dodji at gcc dot gnu dot org @ 2008-11-01 14:31 UTC (permalink / raw)
  To: gcc-bugs



------- 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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/26693] [4.2/4.3/4.4 regression] Access checks not performed for types in templates
  2006-03-15 13:20 [Bug c++/26693] New: [4.0/4.1/4.2 regression] Access checks not performed for types in templates reichelt at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2008-11-01 14:31 ` dodji at gcc dot gnu dot org
@ 2009-01-21 16:15 ` dodji at gcc dot gnu dot org
  2009-01-22  7:16 ` dodji at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: dodji at gcc dot gnu dot org @ 2009-01-21 16:15 UTC (permalink / raw)
  To: gcc-bugs



------- 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=gcc&view=rev&rev=143546
Log:
gcc/ChangeLog:
2009-01-21  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.
        (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  <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.
        * 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  <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/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  <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++.


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/26693] [4.2/4.3/4.4 regression] Access checks not performed for types in templates
  2006-03-15 13:20 [Bug c++/26693] New: [4.0/4.1/4.2 regression] Access checks not performed for types in templates reichelt at gcc dot gnu dot org
                   ` (11 preceding siblings ...)
  2009-01-21 16:15 ` dodji at gcc dot gnu dot org
@ 2009-01-22  7:16 ` dodji at gcc dot gnu dot org
  2009-03-24 13:55 ` howarth at nitro dot med dot uc dot edu
                   ` (8 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: dodji at gcc dot gnu dot org @ 2009-01-22  7:16 UTC (permalink / raw)
  To: gcc-bugs



------- 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=gcc&view=rev&rev=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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/26693] [4.2/4.3/4.4 regression] Access checks not performed for types in templates
  2006-03-15 13:20 [Bug c++/26693] New: [4.0/4.1/4.2 regression] Access checks not performed for types in templates reichelt at gcc dot gnu dot org
                   ` (12 preceding siblings ...)
  2009-01-22  7:16 ` dodji at gcc dot gnu dot org
@ 2009-03-24 13:55 ` howarth at nitro dot med dot uc dot edu
  2009-03-28 20:19 ` reichelt at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2009-03-24 13:55 UTC (permalink / raw)
  To: gcc-bugs



------- 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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/26693] [4.2/4.3/4.4 regression] Access checks not performed for types in templates
  2006-03-15 13:20 [Bug c++/26693] New: [4.0/4.1/4.2 regression] Access checks not performed for types in templates reichelt at gcc dot gnu dot org
                   ` (13 preceding siblings ...)
  2009-03-24 13:55 ` howarth at nitro dot med dot uc dot edu
@ 2009-03-28 20:19 ` reichelt at gcc dot gnu dot org
  2009-03-31 19:31 ` [Bug c++/26693] [4.3/4.4/4.5 " jsm28 at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2009-03-28 20:19 UTC (permalink / raw)
  To: gcc-bugs



------- 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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/26693] [4.3/4.4/4.5 regression] Access checks not performed for types in templates
  2006-03-15 13:20 [Bug c++/26693] New: [4.0/4.1/4.2 regression] Access checks not performed for types in templates reichelt at gcc dot gnu dot org
                   ` (14 preceding siblings ...)
  2009-03-28 20:19 ` reichelt at gcc dot gnu dot org
@ 2009-03-31 19:31 ` jsm28 at gcc dot gnu dot org
  2009-04-02  9:24 ` dodji at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-03-31 19:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from jsm28 at gcc dot gnu dot org  2009-03-31 19:31 -------
Closing 4.2 branch.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.2/4.3/4.4/4.5 regression]|[4.3/4.4/4.5 regression]
                   |Access checks not performed |Access checks not performed
                   |for types in templates      |for types in templates
   Target Milestone|4.2.5                       |4.3.4


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/26693] [4.3/4.4/4.5 regression] Access checks not performed for types in templates
  2006-03-15 13:20 [Bug c++/26693] New: [4.0/4.1/4.2 regression] Access checks not performed for types in templates reichelt at gcc dot gnu dot org
                   ` (15 preceding siblings ...)
  2009-03-31 19:31 ` [Bug c++/26693] [4.3/4.4/4.5 " jsm28 at gcc dot gnu dot org
@ 2009-04-02  9:24 ` dodji at gcc dot gnu dot org
  2009-04-02  9:36 ` dodji at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: dodji at gcc dot gnu dot org @ 2009-04-02  9:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from dodji at gcc dot gnu dot org  2009-04-02 09:24 -------
Subject: Bug 26693

Author: dodji
Date: Thu Apr  2 09:24:19 2009
New Revision: 145440

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145440
Log:
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++.


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
    trunk/gcc/testsuite/g++.dg/template/typedef15.C
    trunk/gcc/testsuite/g++.dg/template/typedef16.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-common.c
    trunk/gcc/c-common.h
    trunk/gcc/c-decl.c
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/class.c
    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/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/ext/bitmap_allocator.h


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/26693] [4.3/4.4/4.5 regression] Access checks not performed for types in templates
  2006-03-15 13:20 [Bug c++/26693] New: [4.0/4.1/4.2 regression] Access checks not performed for types in templates reichelt at gcc dot gnu dot org
                   ` (16 preceding siblings ...)
  2009-04-02  9:24 ` dodji at gcc dot gnu dot org
@ 2009-04-02  9:36 ` dodji at gcc dot gnu dot org
  2009-04-02  9:39 ` dodji at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: dodji at gcc dot gnu dot org @ 2009-04-02  9:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from dodji at gcc dot gnu dot org  2009-04-02 09:36 -------
Okay, I hope this is fixed in trunk now.

I won't apply the fix to the branches because it's too risky. Should I close
the bug ?


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/26693] [4.3/4.4/4.5 regression] Access checks not performed for types in templates
  2006-03-15 13:20 [Bug c++/26693] New: [4.0/4.1/4.2 regression] Access checks not performed for types in templates reichelt at gcc dot gnu dot org
                   ` (17 preceding siblings ...)
  2009-04-02  9:36 ` dodji at gcc dot gnu dot org
@ 2009-04-02  9:39 ` dodji at gcc dot gnu dot org
  2009-04-02  9:45 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: dodji at gcc dot gnu dot org @ 2009-04-02  9:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from dodji at gcc dot gnu dot org  2009-04-02 09:39 -------
I forgot to say that that the patch was accepted at
http://gcc.gnu.org/ml/gcc-patches/2009-04/msg00063.html.


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/26693] [4.3/4.4/4.5 regression] Access checks not performed for types in templates
  2006-03-15 13:20 [Bug c++/26693] New: [4.0/4.1/4.2 regression] Access checks not performed for types in templates reichelt at gcc dot gnu dot org
                   ` (18 preceding siblings ...)
  2009-04-02  9:39 ` dodji at gcc dot gnu dot org
@ 2009-04-02  9:45 ` jakub at gcc dot gnu dot org
  2009-04-29  7:09 ` pinskia at gcc dot gnu dot org
  2009-05-05 13:07 ` jwakely dot gcc at gmail dot com
  21 siblings, 0 replies; 23+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-04-02  9:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from jakub at gcc dot gnu dot org  2009-04-02 09:45 -------
Fixed for 4.5+, won't fix on older branches.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
      Known to work|3.3.3 3.2.3                 |3.3.3 3.2.3 4.5.0
         Resolution|                            |FIXED
   Target Milestone|4.3.4                       |4.5.0


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/26693] [4.3/4.4/4.5 regression] Access checks not performed for types in templates
  2006-03-15 13:20 [Bug c++/26693] New: [4.0/4.1/4.2 regression] Access checks not performed for types in templates reichelt at gcc dot gnu dot org
                   ` (19 preceding siblings ...)
  2009-04-02  9:45 ` jakub at gcc dot gnu dot org
@ 2009-04-29  7:09 ` pinskia at gcc dot gnu dot org
  2009-05-05 13:07 ` jwakely dot gcc at gmail dot com
  21 siblings, 0 replies; 23+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-04-29  7:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from pinskia at gcc dot gnu dot org  2009-04-29 07:09 -------
*** Bug 39956 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kannanmj at hp dot com


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/26693] [4.3/4.4/4.5 regression] Access checks not performed for types in templates
  2006-03-15 13:20 [Bug c++/26693] New: [4.0/4.1/4.2 regression] Access checks not performed for types in templates reichelt at gcc dot gnu dot org
                   ` (20 preceding siblings ...)
  2009-04-29  7:09 ` pinskia at gcc dot gnu dot org
@ 2009-05-05 13:07 ` jwakely dot gcc at gmail dot com
  21 siblings, 0 replies; 23+ messages in thread
From: jwakely dot gcc at gmail dot com @ 2009-05-05 13:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from jwakely dot gcc at gmail dot com  2009-05-05 13:07 -------
I think this fix caused Bug 40007


-- 

jwakely dot gcc at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jwakely dot gcc at gmail dot
                   |                            |com


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2009-05-05 13:07 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-15 13:20 [Bug c++/26693] New: [4.0/4.1/4.2 regression] Access checks not performed for types in templates reichelt at gcc dot gnu dot org
2006-03-15 13:24 ` [Bug c++/26693] " pinskia at gcc dot gnu dot org
2006-06-04 18:06 ` mmitchel at gcc dot gnu dot org
2006-09-07  7:18 ` jason at gcc dot gnu dot org
2007-02-03 16:24 ` [Bug c++/26693] [4.0/4.1/4.2/4.3 " gdr at gcc dot gnu dot org
2007-02-03 17:27 ` jsm28 at gcc dot gnu dot org
2007-02-14  9:10 ` mmitchel at gcc dot gnu dot org
2008-07-04 20:22 ` [Bug c++/26693] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
2008-08-21 11:59 ` paolo dot carlini at oracle dot com
2008-10-28 12:17 ` dodji at gcc dot gnu dot org
2008-10-29 21:56 ` dodji at gcc dot gnu dot org
2008-11-01 14:31 ` dodji at gcc dot gnu dot org
2009-01-21 16:15 ` dodji at gcc dot gnu dot org
2009-01-22  7:16 ` dodji at gcc dot gnu dot org
2009-03-24 13:55 ` howarth at nitro dot med dot uc dot edu
2009-03-28 20:19 ` reichelt at gcc dot gnu dot org
2009-03-31 19:31 ` [Bug c++/26693] [4.3/4.4/4.5 " jsm28 at gcc dot gnu dot org
2009-04-02  9:24 ` dodji at gcc dot gnu dot org
2009-04-02  9:36 ` dodji at gcc dot gnu dot org
2009-04-02  9:39 ` dodji at gcc dot gnu dot org
2009-04-02  9:45 ` jakub at gcc dot gnu dot org
2009-04-29  7:09 ` pinskia at gcc dot gnu dot org
2009-05-05 13:07 ` jwakely dot gcc at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).