From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- gcc/testsuite/g++.old-deja/g++.benjamin/tem05.C | 58 +++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 gcc/testsuite/g++.old-deja/g++.benjamin/tem05.C (limited to 'gcc/testsuite/g++.old-deja/g++.benjamin/tem05.C') diff --git a/gcc/testsuite/g++.old-deja/g++.benjamin/tem05.C b/gcc/testsuite/g++.old-deja/g++.benjamin/tem05.C new file mode 100644 index 000000000..7b6b95538 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.benjamin/tem05.C @@ -0,0 +1,58 @@ +// { dg-do assemble } +// 980924 bkoz +// just a quick test for export, to make sure we are warning for it. +// CHANGE ME when it's supported + + +// 14 Templates +//p 6 +// A namespace-scope declaration or definintion of a non-line function +// template, a non-inline member function template, a non-inline +// 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 +// template is defined in the same translation unit in which it is +// declared as exported, the definition is considered to be +// exported. The first declaration of the template containing the +// export keyword must not follow the definition. (meaning that export +// can't beredeclared as non-export??) + +// 1 +// template definition +export template // { dg-warning "" } +bool templ_one(T a) { + if (a > 0) + return true; + else + return false; +} + + +// 2 +// static data, mf, mf template +template +class X_one { + unsigned short id; + T type; +public: + static const bool is_specialized ; + + X_one(const unsigned short& us = 5): id(us), type(T(0)) {} + unsigned short ret_id (); + template bool compare_ge(T2 test); +}; + +export template // { dg-warning "" } +const bool X_one::is_specialized = false; + +export template // { dg-warning "" } +unsigned short X_one::ret_id() { + return id; +} + +export template // { dg-warning "" } +bool compare_ge(T2 test) { + if (test > type) // { dg-error "" } .* + return true; + return false; +} + -- cgit v1.2.3