URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 301 |
Rev 338 |
// Test for deduction of T as std::initializer_list. This isn't currently
|
// Test for deduction of T as std::initializer_list. This isn't currently
|
// supported by the working draft, but is necessary for perfect forwarding
|
// supported by the working draft, but is necessary for perfect forwarding
|
// of initializer-lists to things that can take a std::initializer_list.
|
// of initializer-lists to things that can take a std::initializer_list.
|
|
|
// { dg-options -std=c++0x }
|
// { dg-options -std=c++0x }
|
// { dg-do run }
|
// { dg-do run }
|
|
|
#include
|
#include
|
|
|
struct A
|
struct A
|
{
|
{
|
A(std::initializer_list) { }
|
A(std::initializer_list) { }
|
};
|
};
|
|
|
void f (A a) { }
|
void f (A a) { }
|
|
|
template
|
template
|
auto g (T&& t) -> decltype (f(t)) // { dg-warning "call" }
|
auto g (T&& t) -> decltype (f(t)) // { dg-warning "call" }
|
{
|
{
|
return f(t);
|
return f(t);
|
}
|
}
|
|
|
int main()
|
int main()
|
{
|
{
|
g({1}); // { dg-warning "deduc" }
|
g({1}); // { dg-warning "deduc" }
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.