Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 29469
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Jason Merrill <jason@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: Martin Michlmayr <tbm@cyrius.com>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
pair.c testcase text/plain 2006-10-14 17:37 410 bytes Edit
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 29469 depends on: 9634 Show dependency tree
Show dependency graph
Bug 29469 blocks: 29607

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: 2009-03-04 16:54 Opened: 2006-10-14 17:37
The following example code compiled fine with 4.1.2 20060901 (Debian 4.1.1-13)
but fails with 4.1.2 20061007 (Debian 4.1.1-16).  I'm wondering whether this
change was intentional and whether there's a good reason for this change (in a
stable branch).

$ g++-4.1 -c pair.c
x.c:32: error: non-template 'pair' used as template
x.c:32: note: use 'avm_map<Key, Value, Compare, equal>::template pair' to
indicate that it is a template

------- Comment #1 From Martin Michlmayr 2006-10-14 17:37 -------
Created an attachment (id=12429) [edit]
testcase

------- Comment #2 From Andrew Pinski 2006-10-14 17:48 -------
The real question is avm_map dependent inside the nested class?
I know there are C++ defect reports asking that question so ...

------- Comment #3 From Andrew Pinski 2006-10-14 18:11 -------
(In reply to comment #2)
> The real question is avm_map dependent inside the nested class?
> I know there are C++ defect reports asking that question so ...
And that is DR 224 which is in WP.

------- Comment #4 From Andrew Pinski 2006-10-14 18:15 -------
I think this is more complicated than just DR 224.
See PR 9634.

------- Comment #5 From Andrew Pinski 2006-10-14 18:25 -------
DR 224 says this is invalid code but GDR has mentioned that DR 224 is broken in
really bad way:

template <class T> struct B : T
{
  void g(void) { B x; x.f(); }
}

struct A
{
  void f(void) {}
}

int main(void)
{
  B<A> t;
  t.g();
}

The above code would be invalid code with the resulution of DR 224.

------- Comment #6 From pinskia@gmail.com 2006-10-14 18:26 -------
Subject: Re:  [DR 224] error: non-template 'pair' used as
        template

On Sat, 2006-10-14 at 18:25 +0000, pinskia at gcc dot gnu dot org wrote:
> 
> ------- Comment #5 from pinskia at gcc dot gnu dot org  2006-10-14 18:25 -------
> DR 224 says this is invalid code 

Sorry valid code.

-- Pinski

------- Comment #7 From Mark Mitchell 2006-11-13 03:40 -------
Waiting for ISO Committee to decide what to do about DR 224.

------- Comment #8 From Steven Bosscher 2007-12-16 23:20 -------
Waiting for DR -> SUSPENDED.

------- Comment #9 From Joseph S. Myers 2008-01-21 16:30 -------
Bugs waiting for the committee should not be release-critical; we can restore
this to P3 and reconsider the priority when unsuspending.

------- Comment #10 From Joseph S. Myers 2008-07-04 21:37 -------
Closing 4.1 branch.

------- Comment #11 From Jason Merrill 2009-03-03 21:10 -------
I don't see any open issues about DR 224 since it went into the WP. 
Unsuspending, P3.

------- Comment #12 From Jason Merrill 2009-03-04 18:42 -------
Subject: Bug 29469

Author: jason
Date: Wed Mar  4 18:42:17 2009
New Revision: 144618

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=144618
Log:
        PR c++/9634
        PR c++/29469
        PR c++/29607
        * decl.c (make_typename_type): Do look inside currently open classes.
        * parser.c (cp_parser_lookup_name): Likewise.
        (cp_parser_template_name): Likewise.
        * pt.c (dependent_scope_p): New function.
        * cp-tree.h: Declare it.
        * class.c (currently_open_class): Return fast if T isn't a class.

Added:
    trunk/gcc/testsuite/g++.dg/template/dependent-name5.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/class.c
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/decl.c
    trunk/gcc/cp/parser.c
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog

------- Comment #13 From Jason Merrill 2009-03-04 19:38 -------
Subject: Bug 29469

Author: jason
Date: Wed Mar  4 19:37:43 2009
New Revision: 144621

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=144621
Log:
        PR c++/9634
        PR c++/29469
        PR c++/29607
        Implement DR 224.
        * decl.c (make_typename_type): Do look inside currently open classes.
        * parser.c (cp_parser_lookup_name): Likewise.
        (cp_parser_template_name): Likewise.
        * pt.c (dependent_scope_p): New function.
        * cp-tree.h: Declare it.
        * class.c (currently_open_class): Return fast if T isn't a class.

Added:
    branches/gcc-4_3-branch/gcc/testsuite/g++.dg/template/dependent-name5.C
      - copied unchanged from r144618,
trunk/gcc/testsuite/g++.dg/template/dependent-name5.C
Modified:
    branches/gcc-4_3-branch/gcc/cp/ChangeLog
    branches/gcc-4_3-branch/gcc/cp/class.c
    branches/gcc-4_3-branch/gcc/cp/cp-tree.h
    branches/gcc-4_3-branch/gcc/cp/decl.c
    branches/gcc-4_3-branch/gcc/cp/parser.c
    branches/gcc-4_3-branch/gcc/cp/pt.c
    branches/gcc-4_3-branch/gcc/testsuite/ChangeLog

------- Comment #14 From Jason Merrill 2009-03-04 19:40 -------
Fixed for 4.3 and 4.4, not applying to 4.2.

------- Comment #15 From Jason Merrill 2009-04-03 17:32 -------
Subject: Bug 29469

Author: jason
Date: Fri Apr  3 17:31:38 2009
New Revision: 145510

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145510
Log:
Revert:
        PR c++/9634
        PR c++/29469
        PR c++/29607
        Implement DR 224.
        * decl.c (make_typename_type): Do look inside currently open classes.
        * parser.c (cp_parser_lookup_name): Likewise.
        (cp_parser_template_name): Likewise.
        * pt.c (dependent_scope_p): New function.
        * cp-tree.h: Declare it.
        * class.c (currently_open_class): Return fast if T isn't a class.

Removed:
    branches/gcc-4_3-branch/gcc/testsuite/g++.dg/template/dependent-name5.C
Modified:
    branches/gcc-4_3-branch/gcc/cp/ChangeLog
    branches/gcc-4_3-branch/gcc/cp/class.c
    branches/gcc-4_3-branch/gcc/cp/cp-tree.h
    branches/gcc-4_3-branch/gcc/cp/decl.c
    branches/gcc-4_3-branch/gcc/cp/parser.c
    branches/gcc-4_3-branch/gcc/cp/pt.c
    branches/gcc-4_3-branch/gcc/testsuite/ChangeLog

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug