Bug 36334 - [4.2 Regression] typedef to function type leads to problems
Summary: [4.2 Regression] typedef to function type leads to problems
Status: VERIFIED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.3.0
: P2 normal
Target Milestone: 4.2.5
Assignee: Jason Merrill
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2008-05-26 13:59 UTC by dominik.strasser
Modified: 2009-05-20 14:59 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.1.3 4.3.3 4.4.0
Known to fail:
Last reconfirmed: 2009-01-14 16:49:27


Attachments
Source code illustrating the problem (134 bytes, text/plain)
2008-05-26 14:01 UTC, dominik.strasser
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dominik.strasser 2008-05-26 13:59:39 UTC
The attached source is accepted by gcc 4.1.2, but not by 4.3.0.
It is also accepted by e.g. the SUN C++ compiler.

I didn't find anything in the release notes why it shouldn't be accepted any more.
Comment 1 dominik.strasser 2008-05-26 14:01:12 UTC
Created attachment 15686 [details]
Source code illustrating the problem
Comment 2 Richard Biener 2008-05-26 14:46:26 UTC
Confirmed.
Comment 3 Jakub Jelinek 2008-11-04 21:08:37 UTC
Caused by PR28588 fix, http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116468
Comment 4 Jason Merrill 2009-01-15 18:14:48 UTC
Subject: Bug 36334

Author: jason
Date: Thu Jan 15 18:14:32 2009
New Revision: 143404

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143404
Log:
        PR c++/36334
        PR c++/37646
        * tree.c (lvalue_p_1): Handle BASELINK.  A COMPONENT_REF to
        a function isn't necessarily an lvalue. Take tree, not const_tree.
        (lvalue_p, real_lvalue_p): Take tree, not const_tree.
        * typeck.c (lvalue_or_else): Likewise.
        * cp-tree.h: Adjust prototypes.

Added:
    trunk/gcc/testsuite/g++.dg/conversion/memfn1.C
    trunk/gcc/testsuite/g++.dg/conversion/memfn2.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/tree.c
    trunk/gcc/cp/typeck.c
    trunk/gcc/testsuite/ChangeLog

Comment 5 Jason Merrill 2009-01-15 22:34:38 UTC
Subject: Bug 36334

Author: jason
Date: Thu Jan 15 22:34:20 2009
New Revision: 143413

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143413
Log:
        PR c++/36334
        PR c++/37646
        * tree.c (lvalue_p_1): Handle BASELINK.  A COMPONENT_REF to
        a function isn't necessarily an lvalue. Take tree, not const_tree.
        (lvalue_p, real_lvalue_p): Take tree, not const_tree.
        * typeck.c (lvalue_or_else): Likewise.
        * cp-tree.h: Adjust prototypes.

        PR c++/31488
        * tree.c (pod_type_p): Return 1 for structs created by the back end.

Added:
    branches/gcc-4_3-branch/gcc/testsuite/g++.dg/conversion/memfn1.C
      - copied unchanged from r143404, trunk/gcc/testsuite/g++.dg/conversion/memfn1.C
    branches/gcc-4_3-branch/gcc/testsuite/g++.dg/conversion/memfn2.C
      - copied unchanged from r143404, trunk/gcc/testsuite/g++.dg/conversion/memfn2.C
    branches/gcc-4_3-branch/gcc/testsuite/g++.dg/other/vararg-3.C
      - copied unchanged from r143308, trunk/gcc/testsuite/g++.dg/other/vararg-3.C
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/tree.c
    branches/gcc-4_3-branch/gcc/cp/typeck.c
    branches/gcc-4_3-branch/gcc/testsuite/ChangeLog

Comment 6 Jason Merrill 2009-01-15 22:56:58 UTC
Fixed for 4.3 and 4.4.  Not fixing for 4.2.
Comment 7 dominik.strasser 2009-05-20 14:59:45 UTC
Works fine in 4.3.3