public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/38030]  New: g++ template with overloaded function behave differently on "g++ 4.3.2" and "g++ 3.4.6"
@ 2008-11-06 10:25 ashutosh dot nema at nechclst dot in
  2008-11-06 11:52 ` [Bug c++/38030] [4.2/4.3/4.4 Regression] " rguenth at gcc dot gnu dot org
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: ashutosh dot nema at nechclst dot in @ 2008-11-06 10:25 UTC (permalink / raw)
  To: gcc-bugs

Dear All,

I am unable to understand following test case behaviour.
When i compile and execute this with g++ 3.4.6 it works fine.
But when i compile and execute this with g++ 4.3.2 it aborts.

I think the test case is OK.
But g++ 4.3.2 having bug.

Below is test case:
==========================================================

#define ieq(X,Y) if((X)!=(Y)) abort();
extern void abort ();
struct B_
{
  int i;
};
struct D_:public B_
{
};
D_ d_;
int f_ (B_ &)
{
  return 100;
}
template < class T > int g_ (T t)
{
  return f_ (d_) + f_ (t);
}
int f_ (D_ &)
{
  return 1;
}
int main (int argc, char *argv[])
{
  D_ d;
  ieq (g_ (d), 101);
  return 0;
}
==========================================================

Please help me regarding this.


-- 
           Summary: g++ template with overloaded function behave differently
                    on "g++ 4.3.2" and "g++ 3.4.6"
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ashutosh dot nema at nechclst dot in


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


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

* [Bug c++/38030] [4.2/4.3/4.4 Regression] g++ template with overloaded function behave differently on "g++ 4.3.2" and "g++ 3.4.6"
  2008-11-06 10:25 [Bug c++/38030] New: g++ template with overloaded function behave differently on "g++ 4.3.2" and "g++ 3.4.6" ashutosh dot nema at nechclst dot in
@ 2008-11-06 11:52 ` rguenth at gcc dot gnu dot org
  2008-11-06 11:54 ` [Bug c++/38030] [4.2/4.3/4.4 Regression] name-lookup for non-dependent name in template function is wrong rguenth at gcc dot gnu dot org
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-11-06 11:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2008-11-06 11:51 -------
Confirmed.  For the following neither f_ nor d_ are dependent and should be
bound to f_ (B_ &) during first-stage name-lookup.  For some reason this
doesn't work - it does if d_ is of type B_ though.

extern "C" void abort ();
struct B_ { };
struct D_:public B_ { };
D_ d_;
void f_ (B_ &) { }
template < class T >
void g_ (T t)
{
  f_ (d_);
}
void f_ (D_ &) { abort (); }
int main (int argc, char *argv[])
{
  D_ d;
  g_ (d);
  return 0;
}


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |wrong-code
      Known to fail|                            |3.3.6 4.1.2 4.3.2
      Known to work|                            |3.4.6
   Last reconfirmed|0000-00-00 00:00:00         |2008-11-06 11:51:12
               date|                            |
            Summary|g++ template with overloaded|[4.2/4.3/4.4 Regression] g++
                   |function behave differently |template with overloaded
                   |on "g++ 4.3.2" and "g++     |function behave differently
                   |3.4.6"                      |on "g++ 4.3.2" and "g++
                   |                            |3.4.6"


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


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

* [Bug c++/38030] [4.2/4.3/4.4 Regression] name-lookup for non-dependent name in template function is wrong
  2008-11-06 10:25 [Bug c++/38030] New: g++ template with overloaded function behave differently on "g++ 4.3.2" and "g++ 3.4.6" ashutosh dot nema at nechclst dot in
  2008-11-06 11:52 ` [Bug c++/38030] [4.2/4.3/4.4 Regression] " rguenth at gcc dot gnu dot org
@ 2008-11-06 11:54 ` rguenth at gcc dot gnu dot org
  2008-11-06 12:09 ` rguenth at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-11-06 11:54 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
            Summary|[4.2/4.3/4.4 Regression] g++|[4.2/4.3/4.4 Regression]
                   |template with overloaded    |name-lookup for non-
                   |function behave differently |dependent name in template
                   |on "g++ 4.3.2" and "g++     |function is wrong
                   |3.4.6"                      |
   Target Milestone|---                         |4.2.5
            Version|unknown                     |4.3.2


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


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

* [Bug c++/38030] [4.2/4.3/4.4 Regression] name-lookup for non-dependent name in template function is wrong
  2008-11-06 10:25 [Bug c++/38030] New: g++ template with overloaded function behave differently on "g++ 4.3.2" and "g++ 3.4.6" ashutosh dot nema at nechclst dot in
  2008-11-06 11:52 ` [Bug c++/38030] [4.2/4.3/4.4 Regression] " rguenth at gcc dot gnu dot org
  2008-11-06 11:54 ` [Bug c++/38030] [4.2/4.3/4.4 Regression] name-lookup for non-dependent name in template function is wrong rguenth at gcc dot gnu dot org
@ 2008-11-06 12:09 ` rguenth at gcc dot gnu dot org
  2008-11-06 12:56 ` jakub at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-11-06 12:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2008-11-06 12:08 -------
Even the following fails

extern "C" void abort ();
struct B_ { };
struct D_ : public B_ { };
D_ d_;
void f_ (B_ &) { }
template < class T >
void g_ ()
{
  return f_ (d_);
}
int main ()
{
  g_<int> ();
  return 0;
}
void f_ (D_ &) { abort (); }

where f_ (D_ &) must not be even in the 2nd stage name-lookup overload set.


-- 


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


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

* [Bug c++/38030] [4.2/4.3/4.4 Regression] name-lookup for non-dependent name in template function is wrong
  2008-11-06 10:25 [Bug c++/38030] New: g++ template with overloaded function behave differently on "g++ 4.3.2" and "g++ 3.4.6" ashutosh dot nema at nechclst dot in
                   ` (3 preceding siblings ...)
  2008-11-06 12:56 ` jakub at gcc dot gnu dot org
@ 2008-11-06 12:56 ` rguenth at gcc dot gnu dot org
  2008-11-14 18:31 ` jason at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-11-06 12:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2008-11-06 12:54 -------
We seem to not know if we bound f_ already.  Instead another round of koenig
lookup is applied from

#0  perform_koenig_lookup (fn=0x7ffff6458500, args=0x7ffff6463480)
    at /space/rguenther/src/svn/trunk/gcc/cp/semantics.c:1797
#1  0x00000000004c9e14 in tsubst_copy_and_build (t=0x7ffff7ebd870, 
    args=0x7ffff64631b0, complain=tf_warning_or_error, in_decl=0x7ffff6461780, 
    function_p=0 '\0', integral_constant_expression_p=0 '\0')
    at /space/rguenther/src/svn/trunk/gcc/cp/pt.c:11293
#2  0x00000000004c6798 in tsubst_expr (t=0x7ffff7ebd870, args=0x7ffff64631b0, 
    complain=tf_warning_or_error, in_decl=0x7ffff6461780, 
    integral_constant_expression_p=0 '\0')
    at /space/rguenther/src/svn/trunk/gcc/cp/pt.c:10880
#3  0x00000000004bff18 in tsubst_expr (t=0x7ffff644a5c0, args=0x7ffff64631b0, 
    complain=tf_warning_or_error, in_decl=0x7ffff6461780, 
    integral_constant_expression_p=0 '\0')
    at /space/rguenther/src/svn/trunk/gcc/cp/pt.c:10483
#4  0x00000000004c1c98 in tsubst_expr (t=0x7ffff7ebd7d0, args=0x7ffff64631b0, 
    complain=tf_warning_or_error, in_decl=0x7ffff6461780, 
    integral_constant_expression_p=0 '\0')
    at /space/rguenther/src/svn/trunk/gcc/cp/pt.c:10630
#5  0x00000000004e78c5 in instantiate_decl (d=0x7ffff6458900, defer_ok=0, 
    expl_inst_class_mem_p=0 '\0')
    at /space/rguenther/src/svn/trunk/gcc/cp/pt.c:15378
#6  0x00000000004e7f8c in instantiate_pending_templates (retries=0)
    at /space/rguenther/src/svn/trunk/gcc/cp/pt.c:15474
#7  0x0000000000540bb0 in cp_write_global_declarations ()
    at /space/rguenther/src/svn/trunk/gcc/cp/decl2.c:3364

note the instantiation is from cp_write_global_declarations which is after
the whole unit is parsed, which may explain comment #2.


-- 


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


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

* [Bug c++/38030] [4.2/4.3/4.4 Regression] name-lookup for non-dependent name in template function is wrong
  2008-11-06 10:25 [Bug c++/38030] New: g++ template with overloaded function behave differently on "g++ 4.3.2" and "g++ 3.4.6" ashutosh dot nema at nechclst dot in
                   ` (2 preceding siblings ...)
  2008-11-06 12:09 ` rguenth at gcc dot gnu dot org
@ 2008-11-06 12:56 ` jakub at gcc dot gnu dot org
  2008-11-06 12:56 ` rguenth at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-11-06 12:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jakub at gcc dot gnu dot org  2008-11-06 12:55 -------
*** Bug 38031 has been marked as a duplicate of this bug. ***


-- 


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


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

* [Bug c++/38030] [4.2/4.3/4.4 Regression] name-lookup for non-dependent name in template function is wrong
  2008-11-06 10:25 [Bug c++/38030] New: g++ template with overloaded function behave differently on "g++ 4.3.2" and "g++ 3.4.6" ashutosh dot nema at nechclst dot in
                   ` (4 preceding siblings ...)
  2008-11-06 12:56 ` rguenth at gcc dot gnu dot org
@ 2008-11-14 18:31 ` jason at gcc dot gnu dot org
  2008-11-14 22:00 ` jason at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-11-14 18:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jason at gcc dot gnu dot org  2008-11-14 18:29 -------
G++ has never done two-phase name binding; that's an area that needs work for
standards conformance.  This testcase worked properly by accident in 3.4 and
4.0, because of an optimization which was disallowed under DR 164.


-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jason at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2008-11-06 11:51:12         |2008-11-14 18:29:59
               date|                            |


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


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

* [Bug c++/38030] [4.2/4.3/4.4 Regression] name-lookup for non-dependent name in template function is wrong
  2008-11-06 10:25 [Bug c++/38030] New: g++ template with overloaded function behave differently on "g++ 4.3.2" and "g++ 3.4.6" ashutosh dot nema at nechclst dot in
                   ` (5 preceding siblings ...)
  2008-11-14 18:31 ` jason at gcc dot gnu dot org
@ 2008-11-14 22:00 ` jason at gcc dot gnu dot org
  2008-11-14 22:04 ` [Bug c++/38030] [4.2/4.3 " jason at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-11-14 22:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jason at gcc dot gnu dot org  2008-11-14 21:59 -------
Subject: Bug 38030

Author: jason
Date: Fri Nov 14 21:57:34 2008
New Revision: 141866

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141866
Log:
        PR c++/38030
        * semantics.c (finish_call_expr): Remember the result of
        non-dependent overload resolution.

Added:
    trunk/gcc/testsuite/g++.dg/template/lookup8.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/semantics.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/38030] [4.2/4.3 Regression] name-lookup for non-dependent name in template function is wrong
  2008-11-06 10:25 [Bug c++/38030] New: g++ template with overloaded function behave differently on "g++ 4.3.2" and "g++ 3.4.6" ashutosh dot nema at nechclst dot in
                   ` (6 preceding siblings ...)
  2008-11-14 22:00 ` jason at gcc dot gnu dot org
@ 2008-11-14 22:04 ` jason at gcc dot gnu dot org
  2008-11-14 23:08 ` jason at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-11-14 22:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jason at gcc dot gnu dot org  2008-11-14 22:02 -------
Subject: Bug 38030

Author: jason
Date: Fri Nov 14 22:01:12 2008
New Revision: 141868

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141868
Log:
        PR c++/38030
        * semantics.c (finish_call_expr): Don't repeat arg-dep lookup
        for a non-dependent call.

Added:
    branches/gcc-4_3-branch/gcc/testsuite/g++.dg/template/lookup8.C
      - copied unchanged from r141866,
trunk/gcc/testsuite/g++.dg/template/lookup8.C
Modified:
    branches/gcc-4_3-branch/gcc/cp/ChangeLog
    branches/gcc-4_3-branch/gcc/cp/semantics.c
    branches/gcc-4_3-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/38030] [4.2/4.3 Regression] name-lookup for non-dependent name in template function is wrong
  2008-11-06 10:25 [Bug c++/38030] New: g++ template with overloaded function behave differently on "g++ 4.3.2" and "g++ 3.4.6" ashutosh dot nema at nechclst dot in
                   ` (7 preceding siblings ...)
  2008-11-14 22:04 ` [Bug c++/38030] [4.2/4.3 " jason at gcc dot gnu dot org
@ 2008-11-14 23:08 ` jason at gcc dot gnu dot org
  2008-11-14 23:17 ` jason at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-11-14 23:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jason at gcc dot gnu dot org  2008-11-14 23:07 -------
Subject: Bug 38030

Author: jason
Date: Fri Nov 14 23:06:11 2008
New Revision: 141872

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141872
Log:
        PR c++/38030
        * semantics.c (finish_call_expr): Don't repeat arg-dep lookup
        for a non-dependent call.

Added:
    branches/gcc-4_2-branch/gcc/testsuite/g++.dg/template/lookup8.C
      - copied unchanged from r141866,
trunk/gcc/testsuite/g++.dg/template/lookup8.C
Modified:
    branches/gcc-4_2-branch/gcc/cp/ChangeLog
    branches/gcc-4_2-branch/gcc/cp/semantics.c
    branches/gcc-4_2-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/38030] [4.2/4.3 Regression] name-lookup for non-dependent name in template function is wrong
  2008-11-06 10:25 [Bug c++/38030] New: g++ template with overloaded function behave differently on "g++ 4.3.2" and "g++ 3.4.6" ashutosh dot nema at nechclst dot in
                   ` (8 preceding siblings ...)
  2008-11-14 23:08 ` jason at gcc dot gnu dot org
@ 2008-11-14 23:17 ` jason at gcc dot gnu dot org
  2008-11-14 23:29 ` rguenther at suse dot de
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-11-14 23:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from jason at gcc dot gnu dot org  2008-11-14 23:16 -------
Fixed.


-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

* [Bug c++/38030] [4.2/4.3 Regression] name-lookup for non-dependent name in template function is wrong
  2008-11-06 10:25 [Bug c++/38030] New: g++ template with overloaded function behave differently on "g++ 4.3.2" and "g++ 3.4.6" ashutosh dot nema at nechclst dot in
                   ` (9 preceding siblings ...)
  2008-11-14 23:17 ` jason at gcc dot gnu dot org
@ 2008-11-14 23:29 ` rguenther at suse dot de
  2009-03-24  5:14 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: rguenther at suse dot de @ 2008-11-14 23:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from rguenther at suse dot de  2008-11-14 23:27 -------
Subject: Re:  [4.2/4.3/4.4 Regression] name-lookup for
 non-dependent name in template function is wrong

On Fri, 14 Nov 2008, jason at gcc dot gnu dot org wrote:

> ------- Comment #5 from jason at gcc dot gnu dot org  2008-11-14 18:29 -------
> G++ has never done two-phase name binding; that's an area that needs work for
> standards conformance.

Doh.  That seems to be a pretty important semantic piece of C++ though ;)

Thanks for fixing this bug so quickly.

Richard.


-- 


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


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

* [Bug c++/38030] [4.2/4.3 Regression] name-lookup for non-dependent name in template function is wrong
  2008-11-06 10:25 [Bug c++/38030] New: g++ template with overloaded function behave differently on "g++ 4.3.2" and "g++ 3.4.6" ashutosh dot nema at nechclst dot in
                   ` (10 preceding siblings ...)
  2008-11-14 23:29 ` rguenther at suse dot de
@ 2009-03-24  5:14 ` pinskia at gcc dot gnu dot org
  2009-03-31 15:43 ` jason at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-03-24  5:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from pinskia at gcc dot gnu dot org  2009-03-24 05:14 -------
*** Bug 39534 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anubhav dot saxena at wipro
                   |                            |dot com


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


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

* [Bug c++/38030] [4.2/4.3 Regression] name-lookup for non-dependent name in template function is wrong
  2008-11-06 10:25 [Bug c++/38030] New: g++ template with overloaded function behave differently on "g++ 4.3.2" and "g++ 3.4.6" ashutosh dot nema at nechclst dot in
                   ` (11 preceding siblings ...)
  2009-03-24  5:14 ` pinskia at gcc dot gnu dot org
@ 2009-03-31 15:43 ` jason at gcc dot gnu dot org
  2009-04-02 18:38 ` jason at gcc dot gnu dot org
  2009-04-03 18:05 ` jason at gcc dot gnu dot org
  14 siblings, 0 replies; 16+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-03-31 15:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from jason at gcc dot gnu dot org  2009-03-31 15:43 -------
Subject: Bug 38030

Author: jason
Date: Tue Mar 31 15:42:58 2009
New Revision: 145360

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145360
Log:
        PR c++/38030, 38850, 39070
        * pt.c (type_dependent_expression_p_push): New fn.
        (tsubst_copy_and_build) [CALL_EXPR]: Only do arg-dep lookup when the
        substitution makes the call non-dependent.  Preserve koenig_p.
        * parser.c (cp_parser_postfix_expression): Only do arg-dep lookup
        for non-dependent calls.
        * semantics.c (finish_call_expr): Revert earlier changes.
        * cp-tree.h: Revert change to finish_call_expr prototype.

Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/parser.c
    trunk/gcc/cp/pt.c
    trunk/gcc/cp/semantics.c


-- 


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


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

* [Bug c++/38030] [4.2/4.3 Regression] name-lookup for non-dependent name in template function is wrong
  2008-11-06 10:25 [Bug c++/38030] New: g++ template with overloaded function behave differently on "g++ 4.3.2" and "g++ 3.4.6" ashutosh dot nema at nechclst dot in
                   ` (12 preceding siblings ...)
  2009-03-31 15:43 ` jason at gcc dot gnu dot org
@ 2009-04-02 18:38 ` jason at gcc dot gnu dot org
  2009-04-03 18:05 ` jason at gcc dot gnu dot org
  14 siblings, 0 replies; 16+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-04-02 18:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from jason at gcc dot gnu dot org  2009-04-02 18:38 -------
Subject: Bug 38030

Author: jason
Date: Thu Apr  2 18:37:57 2009
New Revision: 145468

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145468
Log:
        * mangle.c (write_expression): Mangle dependent name as
        source-name.

        PR c++/38030, 38850, 39070
        * pt.c (type_dependent_expression_p_push): New fn.
        (tsubst_copy_and_build) [CALL_EXPR]: Only do arg-dep lookup when the
        substitution makes the call non-dependent.  Preserve koenig_p.
        * parser.c (cp_parser_postfix_expression): Only do arg-dep lookup
        for non-dependent calls.
        * semantics.c (finish_call_expr): Revert earlier changes.
        * cp-tree.h: Revert change to finish_call_expr prototype.

Modified:
    branches/gcc-4_4-branch/gcc/cp/ChangeLog
    branches/gcc-4_4-branch/gcc/cp/cp-tree.h
    branches/gcc-4_4-branch/gcc/cp/mangle.c
    branches/gcc-4_4-branch/gcc/cp/parser.c
    branches/gcc-4_4-branch/gcc/cp/pt.c
    branches/gcc-4_4-branch/gcc/cp/semantics.c
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/cpp0x/auto12.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/cpp0x/auto6.C


-- 


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


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

* [Bug c++/38030] [4.2/4.3 Regression] name-lookup for non-dependent name in template function is wrong
  2008-11-06 10:25 [Bug c++/38030] New: g++ template with overloaded function behave differently on "g++ 4.3.2" and "g++ 3.4.6" ashutosh dot nema at nechclst dot in
                   ` (13 preceding siblings ...)
  2009-04-02 18:38 ` jason at gcc dot gnu dot org
@ 2009-04-03 18:05 ` jason at gcc dot gnu dot org
  14 siblings, 0 replies; 16+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-04-03 18:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from jason at gcc dot gnu dot org  2009-04-03 18:05 -------
Subject: Bug 38030

Author: jason
Date: Fri Apr  3 18:04:39 2009
New Revision: 145511

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145511
Log:
        PR c++/38030, 38850, 39070
        * pt.c (type_dependent_expression_p_push): New fn.
        (tsubst_copy_and_build) [CALL_EXPR]: Only do arg-dep lookup when the
        substitution makes the call non-dependent.  Preserve koenig_p.
        * parser.c (cp_parser_postfix_expression): Only do arg-dep lookup
        for non-dependent calls.
        * semantics.c (finish_call_expr): Revert earlier changes.
        * cp-tree.h: Revert change to finish_call_expr prototype.

Modified:
    branches/gcc-4_3-branch/gcc/cp/ChangeLog
    branches/gcc-4_3-branch/gcc/cp/cp-tree.h
    branches/gcc-4_3-branch/gcc/cp/parser.c
    branches/gcc-4_3-branch/gcc/cp/pt.c
    branches/gcc-4_3-branch/gcc/cp/semantics.c


-- 


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


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

end of thread, other threads:[~2009-04-03 18:05 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-06 10:25 [Bug c++/38030] New: g++ template with overloaded function behave differently on "g++ 4.3.2" and "g++ 3.4.6" ashutosh dot nema at nechclst dot in
2008-11-06 11:52 ` [Bug c++/38030] [4.2/4.3/4.4 Regression] " rguenth at gcc dot gnu dot org
2008-11-06 11:54 ` [Bug c++/38030] [4.2/4.3/4.4 Regression] name-lookup for non-dependent name in template function is wrong rguenth at gcc dot gnu dot org
2008-11-06 12:09 ` rguenth at gcc dot gnu dot org
2008-11-06 12:56 ` jakub at gcc dot gnu dot org
2008-11-06 12:56 ` rguenth at gcc dot gnu dot org
2008-11-14 18:31 ` jason at gcc dot gnu dot org
2008-11-14 22:00 ` jason at gcc dot gnu dot org
2008-11-14 22:04 ` [Bug c++/38030] [4.2/4.3 " jason at gcc dot gnu dot org
2008-11-14 23:08 ` jason at gcc dot gnu dot org
2008-11-14 23:17 ` jason at gcc dot gnu dot org
2008-11-14 23:29 ` rguenther at suse dot de
2009-03-24  5:14 ` pinskia at gcc dot gnu dot org
2009-03-31 15:43 ` jason at gcc dot gnu dot org
2009-04-02 18:38 ` jason at gcc dot gnu dot org
2009-04-03 18:05 ` jason at gcc dot gnu dot org

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