Bug 48284 - [C++0x] incorrect printing of decltype operand in diagnostic
[C++0x] incorrect printing of decltype operand in diagnostic
Status: RESOLVED FIXED
Product: gcc
Classification: Unclassified
Component: c++
4.5.2
: P3 normal
: 4.6.1
Assigned To: Jason Merrill
: diagnostic
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-25 13:00 UTC by Jonathan Wakely
Modified: 2011-05-27 20:48 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2011-04-08 18:49:17


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Wakely 2011-03-25 13:00:32 UTC
template<typename C>
auto g(C& c) -> decltype (c.f()) { return c.f(); }

template<typename C>
auto g(C& c) -> decltype (c.f()) { return c.f(); }


x.C:5:32: error: redefinition of 'template<class C> decltype (c->f()) g(C&)'
x.C:2:32: error: 'template<class C> decltype (c->f()) g(C&)' previously declared here

The diagnostics show c->f() instead of c.f()

Same result for 4.5 and 4.6, I didn't try 4.7
Comment 1 Andrew Pinski 2011-04-08 18:49:17 UTC
Confirmed.
Comment 2 Jason Merrill 2011-05-27 19:32:01 UTC
Author: jason
Date: Fri May 27 19:31:59 2011
New Revision: 174353

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174353
Log:
	PR c++/48284
	* error.c (dump_expr) [COMPONENT_REF]: Use pp_cxx_dot
	with INDIRECT_REF of REFERENCE_TYPE.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/error6.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/error.c
    trunk/gcc/testsuite/ChangeLog
Comment 3 Jason Merrill 2011-05-27 20:48:19 UTC
Author: jason
Date: Fri May 27 20:48:17 2011
New Revision: 174362

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174362
Log:
	PR c++/48284
	* error.c (dump_expr) [COMPONENT_REF]: Use pp_cxx_dot
	with INDIRECT_REF of REFERENCE_TYPE.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/error6.C
Modified:
    branches/gcc-4_6-branch/gcc/cp/ChangeLog
    branches/gcc-4_6-branch/gcc/cp/error.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
Comment 4 Jason Merrill 2011-05-27 20:48:38 UTC
Fixed for 4.6.1.