URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 301 |
Rev 338 |
// Testcase for deduction of std::initializer_list for auto.
|
// Testcase for deduction of std::initializer_list for auto.
|
// { dg-do run }
|
// { dg-do run }
|
// { dg-options "-std=c++0x" }
|
// { dg-options "-std=c++0x" }
|
|
|
#include
|
#include
|
#include
|
#include
|
extern "C" void abort();
|
extern "C" void abort();
|
|
|
template
|
template
|
void f (T t)
|
void f (T t)
|
{
|
{
|
auto ilt = { &t, &t };
|
auto ilt = { &t, &t };
|
if (typeid(ilt) != typeid(std::initializer_list))
|
if (typeid(ilt) != typeid(std::initializer_list))
|
abort();
|
abort();
|
|
|
auto il = { 1, 2, 3 };
|
auto il = { 1, 2, 3 };
|
if (typeid(il) != typeid(std::initializer_list))
|
if (typeid(il) != typeid(std::initializer_list))
|
abort();
|
abort();
|
}
|
}
|
|
|
int main()
|
int main()
|
{
|
{
|
auto il = { 1, 2, 3 };
|
auto il = { 1, 2, 3 };
|
if (typeid(il) != typeid(std::initializer_list))
|
if (typeid(il) != typeid(std::initializer_list))
|
abort();
|
abort();
|
|
|
f('c');
|
f('c');
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.