aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/template/unify6.C
blob: 551c96ebb9fedc8915164f6fa7c70db8c64d2b67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright (C) 2004 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 1 Apr 2004 <nathan@codesourcery.com>

void Baz ();

template <typename T> void Foo1 (T *); // #1
template <typename T> void Foo1 (T const *a) {a (1);} // #2

template <typename T> T const *Foo2 (T *);

template <typename T> void Foo3 (T *, T const * = 0); // { dg-message "note" }

void Bar ()
{
  Foo1 (&Baz); // #1

  Foo2 (&Baz);

  Foo3 (&Baz);

  Foo3 (&Baz, &Baz); // { dg-error "no matching function" "" }
  // { dg-message "(candidate|incompatible cv-qualifiers)" "candidate note" { target *-*-* } 21 }
}