http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59176
--- Comment #18 from Markus Trippelsdorf <trippels at gcc dot gnu.org> --- markus@x4 tmp % cat test.ii class ASN1Object { public: virtual ~ASN1Object (); }; class A { virtual unsigned m_fn1 () const; }; class B { public: ASN1Object Element; virtual unsigned m_fn1 (bool) const; }; template <class BASE> class C : public BASE { }; class D : ASN1Object, public B { }; class G : public D { unsigned m_fn1 (bool) const {} }; class F : A { public: F (A); unsigned m_fn1 () const { int a; a = m_fn2 ().m_fn1 (0); return a; } const B &m_fn2 () const { return m_groupParameters; } C<G> m_groupParameters; }; template <class D> void BenchMarkKeyAgreement (int *, int *, int) { A f; D d (f); } void BenchmarkAll2 () { BenchMarkKeyAgreement<F>(0, 0, 0); } markus@x4 tmp % g++ -c -O3 test.ii test.ii:46:60: error: edge points to wrong declaration: void BenchmarkAll2 () { BenchMarkKeyAgreement<F>(0, 0, 0); } ^ <function_decl 0x7fd4c010fa00 m_fn1.constprop type <function_type 0x7fd4c00d3348 type <integer_type 0x7fd4bff4a738 unsigned int public unsigned SI size <integer_cst 0x7fd4bff4c440 constant 32> unit size <integer_cst 0x7fd4bff4c460 constant 4> align 32 symtab 0 alias set -1 canonical type 0x7fd4bff4a738 precision 32 min <integer_cst 0x7fd4bff4c480 0> max <integer_cst 0x7fd4bff4c420 4294967295> pointer_to_this <pointer_type 0x7fd4c0060150>> QI size <integer_cst 0x7fd4bff4c280 constant 8> unit size <integer_cst 0x7fd4bff4c2a0 constant 1> align 8 symtab 0 alias set -1 canonical type 0x7fd4c00d3348 arg-types <tree_list 0x7fd4bff48b40 value <void_type 0x7fd4bff5d000 void>>> readonly addressable used nothrow private static autoinline decl_5 QI defer-output file test.ii line 25 col 12 align 16 context <record_type 0x7fd4c00b7e70 G>> Instead of: <function_decl 0x7fd4c00b8c00 _ZThn8_NK1G5m_fn1Eb type <method_type 0x7fd4c00ba150 type <integer_type 0x7fd4bff4a738 unsigned int public unsigned SI size <integer_cst 0x7fd4bff4c440 constant 32> unit size <integer_cst 0x7fd4bff4c460 constant 4> align 32 symtab 0 alias set -1 canonical type 0x7fd4bff4a738 precision 32 min <integer_cst 0x7fd4bff4c480 0> max <integer_cst 0x7fd4bff4c420 4294967295> pointer_to_this <pointer_type 0x7fd4c0060150>> QI size <integer_cst 0x7fd4bff4c280 constant 8> unit size <integer_cst 0x7fd4bff4c2a0 constant 1> align 8 symtab 0 alias set -1 canonical type 0x7fd4c00ba150 method basetype <record_type 0x7fd4c00b7e70 G> arg-types <tree_list 0x7fd4c00abca8 value <pointer_type 0x7fd4c00ba1f8> chain <tree_list 0x7fd4c00ab3c0 value <boolean_type 0x7fd4bff4abd0 bool> chain <tree_list 0x7fd4bff48b40 value <void_type 0x7fd4bff5d000 void>>>> pointer_to_this <pointer_type 0x7fd4c00baa80>> readonly addressable asm_written used public weak virtual decl_5 QI file test.ii line 25 col 12 align 8 context <record_type 0x7fd4c00b7e70 G> arguments <parm_decl 0x7fd4c00bb380 this type <pointer_type 0x7fd4c00ba2a0 type <record_type 0x7fd4c00ba0a8 G> readonly unsigned DI size <integer_cst 0x7fd4bff4c0c0 constant 64> unit size <integer_cst 0x7fd4bff4c0e0 constant 8> align 64 symtab 0 alias set -1 canonical type 0x7fd4c00ba2a0> readonly unsigned DI file test.ii line 25 col 25 size <integer_cst 0x7fd4bff4c0c0 64> unit size <integer_cst 0x7fd4bff4c0e0 8> align 64 context <function_decl 0x7fd4c00b8c00 _ZThn8_NK1G5m_fn1Eb> arg-type <pointer_type 0x7fd4c00ba2a0> chain <parm_decl 0x7fd4c00bb400 D.2326 type <boolean_type 0x7fd4bff4abd0 bool> unsigned QI file test.ii line 25 col 19 size <integer_cst 0x7fd4bff4c280 8> unit size <integer_cst 0x7fd4bff4c2a0 1> align 8 context <function_decl 0x7fd4c00b8c00 _ZThn8_NK1G5m_fn1Eb> arg-type <integer_type 0x7fd4bff4a690 int>>> full-name "virtual unsigned int G::_ZThn8_NK1G5m_fn1Eb(bool) const" > _ZNK1F5m_fn1Ev/3 (virtual unsigned int F::m_fn1() const) @0x7fd4c00c4290 Type: function definition analyzed Visibility: externally_visible public weak comdat comdat_group:_ZNK1F5m_fn1Ev one_only virtual Address is taken. References: Referring: _ZTV1F/31 (addr) Availability: available First run: 0 Function flags: body Called by: Calls: _ZNK1G5m_fn1Eb.constprop.1/73 (1.00 per call) (can throw external) test.ii:46:60: internal compiler error: verify_cgraph_node failed