OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [g++.dg/] [ext/] [is_pod.C] - Diff between revs 301 and 384

Only display areas with differences | Details | Blame | View Log

Rev 301 Rev 384
// { dg-options "-std=c++0x" }
// { dg-options "-std=c++0x" }
// { dg-do "run" }
// { dg-do "run" }
#include 
#include 
struct A
struct A
{
{
  double a;
  double a;
  double b;
  double b;
};
};
struct B
struct B
{
{
  B() { }
  B() { }
};
};
struct C
struct C
: public A { };
: public A { };
template
template
  bool
  bool
  f()
  f()
  { return __is_pod(T); }
  { return __is_pod(T); }
template
template
  class My
  class My
  {
  {
  public:
  public:
    bool
    bool
    f()
    f()
    { return !!__is_pod(T); }
    { return !!__is_pod(T); }
  };
  };
template
template
  class My2
  class My2
  {
  {
  public:
  public:
    static const bool trait = __is_pod(T);
    static const bool trait = __is_pod(T);
  };
  };
template
template
  const bool My2::trait;
  const bool My2::trait;
template
template
  struct My3_help
  struct My3_help
  { static const bool trait = b; };
  { static const bool trait = b; };
template
template
  const bool My3_help::trait;
  const bool My3_help::trait;
template
template
  class My3
  class My3
  {
  {
  public:
  public:
    bool
    bool
    f()
    f()
    { return My3_help::trait; }
    { return My3_help::trait; }
  };
  };
#define PTEST(T) (__is_pod(T) && f() \
#define PTEST(T) (__is_pod(T) && f() \
                  && My().f() && My2::trait && My3().f())
                  && My().f() && My2::trait && My3().f())
#define NTEST(T) (!__is_pod(T) && !f() \
#define NTEST(T) (!__is_pod(T) && !f() \
                  && !My().f() && !My2::trait && !My3().f())
                  && !My().f() && !My2::trait && !My3().f())
int main()
int main()
{
{
  assert (PTEST (int));
  assert (PTEST (int));
  assert (NTEST (void));
  assert (NTEST (void));
  assert (PTEST (A));
  assert (PTEST (A));
  assert (PTEST (A[]));
  assert (PTEST (A[]));
  assert (NTEST (B));
  assert (NTEST (B));
  assert (PTEST (C));
  assert (PTEST (C));
  assert (PTEST (C[]));
  assert (PTEST (C[]));
  return 0;
  return 0;
}
}
 
 

powered by: WebSVN 2.1.0

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