Bug 33844 - [4.2 regression] Broken diagnostic: 'dotstar_expr/member_ref' not supported by pp_cxx_unqualified_id
Summary: [4.2 regression] Broken diagnostic: 'dotstar_expr/member_ref' not supported b...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: 4.3.0
Assignee: Jakub Jelinek
URL:
Keywords: diagnostic, monitored
Depends on:
Blocks:
 
Reported: 2007-10-20 22:14 UTC by Volker Reichelt
Modified: 2009-03-31 00:34 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.3.0
Known to fail: 4.2.5
Last reconfirmed: 2007-10-26 16:17:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2007-10-20 22:14:10 UTC
The C++ generates a broken diagnostic for the following invalid code
snippet since GCC 3.4.0:

=====================================
struct A {};

template<int> void foo(void (A::* f)())
{
  A a;
  &(a.*f); 
}
=====================================

bug.cc: In function 'void foo(void (A::*)())':
bug.cc:6: error: invalid use of '#'dotstar_expr' not supported by dump_expr#<expression error>' to form a pointer-to-member-function
bug.cc:6: note:   a qualified-id is required

Same with pointers:

=====================================
struct A {};

template<int> void foo(void (A::* f)())
{
  A *p;
  &(p->*f); 
}
=====================================

bug.cc: In function 'void foo(void (A::*)())':
bug.cc:6: error: invalid use of '#'member_ref' not supported by dump_expr#<expression error>' to form a pointer-to-member-function
bug.cc:6: note:   a qualified-id is required
Comment 1 Jakub Jelinek 2007-10-27 15:55:45 UTC
Subject: Bug 33844

Author: jakub
Date: Sat Oct 27 15:55:34 2007
New Revision: 129682

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129682
Log:
	PR c++/33844
	* cxx-pretty-print.c (pp_cxx_pm_expression) <case MEMBER_REF>: Print
	->* rather than .*.
	* error.c (dump_expr): Handle MEMBER_REF and DOTSTAR_EXPR.

	* g++.dg/other/ptrmem8.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/other/ptrmem8.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cxx-pretty-print.c
    trunk/gcc/cp/error.c
    trunk/gcc/testsuite/ChangeLog

Comment 2 Jakub Jelinek 2007-10-27 15:58:41 UTC
Fixed on the trunk so far.
Comment 3 Joseph S. Myers 2008-07-04 22:20:12 UTC
Closing 4.1 branch.
Comment 4 Joseph S. Myers 2009-03-31 00:34:57 UTC
Closing 4.2 branch, fixed in 4.3.