summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/g++.dg/cpp0x/nullptr19.C
blob: cf30f1c2396f76667d2abab2eb5a20f09a5d01ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// { dg-do compile }
// { dg-options "-std=c++0x" }

// Test overload of pointer versus nullptr_t when applied on a literal 0/__null

typedef decltype(nullptr) nullptr_t;

char* k( char* );	/* { dg-message "note" } { dg-message "note" } */
nullptr_t k( nullptr_t ); /* { dg-message "note" } { dg-message "note" } */

void test_k()
{
  k(0); /* { dg-error "is ambiguous" } */
  // { dg-message "candidate" "candidate note" { target *-*-* } 13 }
  k(__null); /* { dg-error "is ambiguous" } */
  // { dg-message "candidate" "candidate note" { target *-*-* } 15 }
}
OpenPOWER on IntegriCloud