Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
EXTERN_TEMPLATE_BEFORE_DEFINITION.cpp
Go to the documentation of this file.
1// checking for extern template before definition
2
3
25#include "config.h"
26
27#ifndef _RWSTD_NO_extern_template_before_definition_imp
28 // establish a dependency on the source file to get it
29 // compiled first and link with the object file
30 // LDOPTS = extern_template_before_definition_imp.o
31#endif
32
33#ifdef _RWSTD_NO_IMPLICIT_INCLUSION
34 // tell "instantiation_before_definition.h" to #include its
35 // implementation file, instantiation_before_definition.cc
36# define INCLUDE_CC_FILE
37#endif // _RWSTD_NO_IMPLICIT_INCLUSION
38
39#ifdef _RWSTD_NO_EXTERN_FUNCTION_TEMPLATE
40 // tell "instantiation_before_definition.h" to use explicit
41 // function template specialization instead of the extern
42 // template extension
43# define SPECIALIZE_FUNCTION_TEMPLATE
44#endif // _RWSTD_NO_EXTERN_FUNCTION_TEMPLATE
45
46#define EXTERN_TEMPLATE
48
49// test exercises the ability to declare an explicit instantiation
50// of a template using the "extern template" syntax and lexically
51// before the definition of the template (exercises, for example,
52// gcc 4.0.2 bug #24511:
53// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24511)
54
55int main ()
56{
58
59 return ibd.defined_first (0)
60 + ibd.instantiated_first (0)
62}
T instantiated_before_defined(T t)