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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [initlist-deduce.C] - Blame information for rev 315

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
// Test for deduction of T as std::initializer_list.  This isn't currently
2
// supported by the working draft, but is necessary for perfect forwarding
3
// of initializer-lists to things that can take a std::initializer_list.
4
 
5
// { dg-options -std=c++0x }
6
// { dg-do run }
7
 
8
#include 
9
 
10
struct A
11
{
12
  A(std::initializer_list) { }
13
};
14
 
15
void f (A a) { }
16
 
17
template 
18
auto g (T&& t) -> decltype (f(t)) // { dg-warning "call" }
19
{
20
  return f(t);
21
}
22
 
23
int main()
24
{
25
  g({1});                       // { dg-warning "deduc" }
26
}

powered by: WebSVN 2.1.0

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