OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.dg/] [template/] [qualttp19.C] - Diff between revs 301 and 338

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

Rev 301 Rev 338
// { dg-do compile }
// { dg-do compile }
// Copyright (C) 2001 Free Software Foundation, Inc.
// Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 15 Dec 2001 
// Contributed by Nathan Sidwell 15 Dec 2001 
// PR 2645
// PR 2645
template 
template 
struct call_traits
struct call_traits
{
{
  public:
  public:
  typedef T type_less_spec;
  typedef T type_less_spec;
};
};
template 
template 
struct call_traits
struct call_traits
{
{
  typedef T type_more_spec;
  typedef T type_more_spec;
};
};
int main()
int main()
{
{
  int num;
  int num;
   // Two typedefs lead to the instant. of the less spec. ("wrong") template
   // Two typedefs lead to the instant. of the less spec. ("wrong") template
  typedef int& r_type;
  typedef int& r_type;
  typedef const r_type cr_type;
  typedef const r_type cr_type;
  call_traits::type_less_spec var  = num; // { dg-error "" "" }
  call_traits::type_less_spec var  = num; // { dg-error "" "" }
   // The explicit type leads to the instantiation of the "correct" one
   // The explicit type leads to the instantiation of the "correct" one
  call_traits::type_more_spec var2 = num;
  call_traits::type_more_spec var2 = num;
   // As happen with a single typedef!
   // As happen with a single typedef!
  typedef const int& std_cr_type;
  typedef const int& std_cr_type;
  call_traits::type_more_spec var3 = num;
  call_traits::type_more_spec var3 = num;
   // As happen, indeed, without the cv-qualifier
   // As happen, indeed, without the cv-qualifier
  call_traits::type_more_spec var4;
  call_traits::type_more_spec var4;
}
}
 
 

powered by: WebSVN 2.1.0

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