This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

C++ PATCH: PR 15875/21339


Volker pointed out that the testcase from PR 15875 started ICE'ing on
the 3.4 branch after my recent backport of the patch for 18464, and
opened PR 21339.  I've fixed that problem by reverting (on the 3.4
branch only) a portion of the 18464 backport that, it turns out, was
not actually necessary to fix the bug.  I've also added the testcase
to 3.4, 4.0, and mainline.

Tested on x86_64-unknown-linux-gnu, applied as described above.

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com

2005-05-02  Mark Mitchell  <mark@codesourcery.com>

	Revert:
	2005-05-01  Mark Mitchell  <mark@codesourcery.com>
	* typeck.c (unary_complex_lvalue): In a template, always refuse
	simplifications.

2005-05-02  Mark Mitchell  <mark@codesourcery.com>

	PR c++/15875
	* g++.dg/template/ptrmem14.C: New test.

Index: testsuite/g++.dg/template/ptrmem14.C
===================================================================
RCS file: testsuite/g++.dg/template/ptrmem14.C
diff -N testsuite/g++.dg/template/ptrmem14.C
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- testsuite/g++.dg/template/ptrmem14.C	2 May 2005 15:37:07 -0000
***************
*** 0 ****
--- 1,12 ----
+ // PR c++/15875
+ 
+ struct A
+ {
+   void foo();
+ };
+ 
+ template<int> void bar()
+ {
+   typedef void (A::*fptr)();
+   fptr ptr = &A::foo;
+ }
Index: cp/typeck.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/typeck.c,v
retrieving revision 1.519.2.26
diff -c -5 -p -r1.519.2.26 typeck.c
*** cp/typeck.c	1 May 2005 23:26:25 -0000	1.519.2.26
--- cp/typeck.c	2 May 2005 15:43:12 -0000
*************** build_unary_op (enum tree_code code, tre
*** 4170,4185 ****
     NULL_TREE.  */
     
  tree
  unary_complex_lvalue (enum tree_code code, tree arg)
  {
-   /* Inside a template, making these kinds of adjustments is
-      pointless; we are only concerned with the type of the
-      expression.  */
-   if (processing_template_decl)
-     return NULL_TREE;
- 
    /* Handle (a, b) used as an "lvalue".  */
    if (TREE_CODE (arg) == COMPOUND_EXPR)
      {
        tree real_result = build_unary_op (code, TREE_OPERAND (arg, 1), 0);
        return build (COMPOUND_EXPR, TREE_TYPE (real_result),
--- 4170,4179 ----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]