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/] [auto4.C] - Rev 301

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');
}

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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