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++.old-deja/] [g++.benjamin/] [tem05.C] - Diff between revs 305 and 338

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

Rev 305 Rev 338
// { dg-do assemble  }
// { dg-do assemble  }
// 980924 bkoz
// 980924 bkoz
// just a quick test for export, to make sure we are warning for it.
// just a quick test for export, to make sure we are warning for it.
// CHANGE ME when it's supported
// CHANGE ME when it's supported
// 14 Templates
// 14 Templates
//p 6
//p 6
// A namespace-scope declaration or definintion of a non-line function
// A namespace-scope declaration or definintion of a non-line function
// template, a non-inline member function template, a non-inline
// template, a non-inline member function template, a non-inline
// member function of a class template or a static data member of a
// member function of a class template or a static data member of a
// class template may be preceeded by the export keyword. If such a
// class template may be preceeded by the export keyword. If such a
// template is defined in the same translation unit in which it is
// template is defined in the same translation unit in which it is
// declared as exported, the definition is considered to be
// declared as exported, the definition is considered to be
// exported. The first declaration of the template containing the
// exported. The first declaration of the template containing the
// export keyword must not follow the definition. (meaning that export
// export keyword must not follow the definition. (meaning that export
// can't beredeclared as non-export??)
// can't beredeclared as non-export??)
// 1
// 1
// template definition
// template definition
export template   // { dg-warning "" }
export template   // { dg-warning "" }
bool templ_one(T a) {
bool templ_one(T a) {
   if (a > 0)
   if (a > 0)
     return true;
     return true;
   else
   else
     return false;
     return false;
}
}
// 2
// 2
// static data, mf, mf template
// static data, mf, mf template
template 
template 
class X_one {
class X_one {
  unsigned short        id;
  unsigned short        id;
  T     type;
  T     type;
public:
public:
  static const bool     is_specialized ;
  static const bool     is_specialized ;
  X_one(const unsigned short& us = 5): id(us), type(T(0)) {}
  X_one(const unsigned short& us = 5): id(us), type(T(0)) {}
  unsigned short ret_id ();
  unsigned short ret_id ();
  template  bool compare_ge(T2 test);
  template  bool compare_ge(T2 test);
};
};
export template  // { dg-warning "" }
export template  // { dg-warning "" }
const bool X_one::is_specialized = false;
const bool X_one::is_specialized = false;
export template  // { dg-warning "" }
export template  // { dg-warning "" }
unsigned short X_one::ret_id() {
unsigned short X_one::ret_id() {
  return id;
  return id;
}
}
export template  // { dg-warning "" }
export template  // { dg-warning "" }
bool compare_ge(T2 test) {
bool compare_ge(T2 test) {
  if (test > type) // { dg-error "" } .*
  if (test > type) // { dg-error "" } .*
    return true;
    return true;
  return false;
  return false;
}
}
 
 

powered by: WebSVN 2.1.0

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