OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [nullptr15.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do compile }
2
// { dg-options "-std=c++0x" }
3
 
4
// Test template deduction
5
 
6
template  struct tType_equal;
7
template  struct tType_equal { typedef void type; };
8
 
9
template 
10
inline typename tType_equal::type
11
type_equal(U) { }
12
 
13
template T* g( T* t ); // { dg-message "note" }
14
 
15
void test_g()
16
{
17
  // Deduction to nullptr_t, no deduction to pointer type
18
  //
19
  g(nullptr);               // { dg-error "no matching function for call to " }
20
  // { dg-message "(candidate|mismatched types)" "candidate note" { target *-*-* } 19 }
21
  type_equal(g((float*)nullptr));
22
  decltype(nullptr) mynull = 0;
23
  g(mynull);                // { dg-error "no matching function for call to " }
24
  // { dg-message "(candidate|mismatched types)" "candidate note" { target *-*-* } 23 }
25
  type_equal(g((float*)mynull));
26
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.