URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [auto4.C] - Rev 693
Compare with Previous | Blame | View Log
// Testcase for deduction of std::initializer_list for auto.
// { dg-do run }
// { dg-options "-std=c++0x" }
#include <typeinfo>
#include <initializer_list>
extern "C" void abort();
template <class T>
void f (T t)
{
auto ilt = { &t, &t };
if (typeid(ilt) != typeid(std::initializer_list<T*>))
abort();
auto il = { 1, 2, 3 };
if (typeid(il) != typeid(std::initializer_list<int>))
abort();
}
int main()
{
auto il = { 1, 2, 3 };
if (typeid(il) != typeid(std::initializer_list<int>))
abort();
f('c');
}