Commit 41dc4816 by Alexandre Oliva Committed by Alexandre Oliva

instantiate1.C: Adjust to accommodate peculiarities of the SH.

* g++.old-deja/g++.ext/instantiate1.C: Adjust to accommodate
peculiarities of the SH.
* g++.old-deja/g++.ext/instantiate2.C: Likewise.

From-SVN: r41045
parent 47a15d4f
2001-04-03 Alexandre Oliva <aoliva@redhat.com>
* g++.old-deja/g++.ext/instantiate1.C: Adjust to accommodate
peculiarities of the SH.
* g++.old-deja/g++.ext/instantiate2.C: Likewise.
2001-04-02 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> 2001-04-02 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* gcc.c-torture/execute/ieee/fp-cmp-1.c: Renamed nan to dnan. * gcc.c-torture/execute/ieee/fp-cmp-1.c: Renamed nan to dnan.
...@@ -210,7 +216,6 @@ ...@@ -210,7 +216,6 @@
* g++.old-deja/g++.pt/overload15.C: New test to stress overloaded * g++.old-deja/g++.pt/overload15.C: New test to stress overloaded
templatized constructors. templatized constructors.
>>>>>>> 1.1119
2001-02-24 Franz Sirl <Franz.Sirl-kernel@lauterbach.com> 2001-02-24 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
* gcc.c-torture/execute/20010224-1.c: New test. * gcc.c-torture/execute/20010224-1.c: New test.
......
...@@ -13,12 +13,22 @@ template <class T> struct A { ...@@ -13,12 +13,22 @@ template <class T> struct A {
template <class T> void A<T>::f () { } template <class T> void A<T>::f () { }
extern template struct A<int>; extern template struct A<int>;
// These functions must be defined in a single line, so that, even if
// constants or pointers are placed in the code section (for example,
// on the SH), we still get the same line numbers.
void test_f_int () { f(42); } // ERROR - not instantiated
void test_A_int_f () { A<int> a; a.f (); } // ERROR - not instantiated
void test_f_double () { f (2.0); } // gets bogus error
void test_A_double_f () { A<double> b; b.f (); } // gets bogus error
int main () int main ()
{ {
f (42); // ERROR - not instantiated test_f_int ();
A<int> a; test_A_int_f ();
a.f (); // ERROR - not instantiated test_f_double ();
f (2.0); // gets bogus error test_A_double_f ();
A<double> b;
b.f (); // gets bogus error
} }
...@@ -10,10 +10,17 @@ template <class T> struct A { ...@@ -10,10 +10,17 @@ template <class T> struct A {
template <class T> T A<T>::t = 0; template <class T> T A<T>::t = 0;
static template struct A<int>; static template struct A<int>;
// These functions must be defined in a single line, so that, even if
// constants or pointers are placed in the code section (for example,
// on the SH), we still get the same line numbers.
void test_int() { A<int>::t = 42; } // gets bogus error
void test_char() { A<char>::t = 42; } // ERROR - not instantiated XFAIL *-*-irix*
// Irix's default linker does not produce line numbers so XFAIL it.
int main () int main ()
{ {
A<int>::t = 42; // gets bogus error test_int ();
A<char>::t = 42; // ERROR - not instantiated XFAIL mips*-*-* test_char ();
// Irix's default linker does not
// produce line numbers so XFAIL it.
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment