struct Node { }; struct E { class K {}; static const K &N; int f(Node&, const K&); }; template<typename T> struct R : Node { R(E &g) : r(g.f(*this,E::N)) {} int r; }; int main() { E e; R<int> n(e); } e.cc: In instantiation of 'R<T>::R(E&) [with T = int]': e.cc:25:15: required from here e.cc:15:21: error: '#'indirect_ref' not supported by dump_decl#<declaration error>' is not a member of 'E' : r(g.f(*this,E::N)) ^
Fails with gcc version 4.8.0 20121007 (experimental) (GCC) The code should be accepted, and the diagnostic should make sense!
The diagnostic issue is known (PR51413). Can you please figure out when it started?
I'll bisect ...
d0b4bf064cc775c510f804bee8394067530cc2bb is the first bad commit commit d0b4bf064cc775c510f804bee8394067530cc2bb Author: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Fri Aug 31 02:50:18 2012 +0000 * semantics.c (finish_qualified_id_expr): Handle building up a non-dependent SCOPE_REF here. (finish_id_expression): Not here. * error.c (dump_decl) [SCOPE_REF]: Only pass TFF_UNQUALIFIED_NAME. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190829 138bc75d-0d04-0410-961f-82ee72b054a4
Reduced: struct E { static const int& e; }; template<typename> struct R { R() { E::e; } }; R<int> r; The error goes away unless: - E::e is a reference - R is a template - the lookup is in a constructor
Confirmed.
Author: jason Date: Thu Dec 6 20:20:52 2012 New Revision: 194266 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=194266 Log: PR c++/54913 * semantics.c (finish_qualified_id_expr): convert_from_reference after building a SCOPE_REF. Added: trunk/gcc/testsuite/g++.dg/template/qualified-id6.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/semantics.c
Fixed.