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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [nullptr17.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 that bool is a better overload match than int
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
int i( int );
14
long int i( long int );
15
bool i( bool );
16
 
17
void test_i()
18
{
19
  // Overload to bool, not int
20
  type_equal(i(nullptr));
21
  decltype(nullptr) mynull = 0;
22
  type_equal(i(mynull));
23
}

powered by: WebSVN 2.1.0

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