view gcc/testsuite/g++.dg/overload/koenig1.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
line wrap: on
line source

// PR c++/9336
// Bug: The first, invalid call to f caused us to crash on the second,
// valid call.

namespace N {
  template <class T> void f (T); // { dg-message "N::f" }
  struct A;
}

struct B;

void g ()
{
  B *bp;
  N::A *ap;
  f (bp);			// { dg-error "3:'f' was not declared in this scope; did you mean 'N::f'" }
  f (ap);
}