stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r328919 - in /incubator/stdcxx/trunk/etc/config/src: EXPORT.cpp EXPORT_KEYWORD.cpp
Date Thu, 27 Oct 2005 18:03:04 GMT
Author: sebor
Date: Thu Oct 27 11:02:59 2005
New Revision: 328919

URL: http://svn.apache.org/viewcvs?rev=328919&view=rev
Log:
2005-10-27  Martin Sebor  <sebor@roguewave.com>

	STDCXX-58
	* EXPORT.cpp: Linked with EXPORT_KEYWORD.o, renamed templates to prevent
	compilers such as Compaq C++ from finding symbols defined in other tests
	when looking through a template repository.
	* EXPORT_KEYWORD.cpp: Renamed template.


Modified:
    incubator/stdcxx/trunk/etc/config/src/EXPORT.cpp
    incubator/stdcxx/trunk/etc/config/src/EXPORT_KEYWORD.cpp

Modified: incubator/stdcxx/trunk/etc/config/src/EXPORT.cpp
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/etc/config/src/EXPORT.cpp?rev=328919&r1=328918&r2=328919&view=diff
==============================================================================
--- incubator/stdcxx/trunk/etc/config/src/EXPORT.cpp (original)
+++ incubator/stdcxx/trunk/etc/config/src/EXPORT.cpp Thu Oct 27 11:02:59 2005
@@ -9,24 +9,35 @@
 
 // establish a dependency on EXPORT_KEYWORD.cpp which must be
 // compiled first since it defines the exported function template
- 
+// LDOPTS = EXPORT_KEYWORD.o 
 #endif   // _RWSTD_NO_EXPORT_KEYWORD
 
 
 export template <class T>
-T foo (T);
+T exported_function_template (T);
 
 export template <class T>
-struct S
+struct ExportedClass
 {
-    T bar ();
+    T exported_class_member (T);
 };
 
 template <class T>
-T S<T>::bar () { return foo (T ()); }
+T ExportedClass<T>::
+exported_class_member (T t) {
+    return exported_function_template (t);
+}
+
+
+struct MyClass {
+    int i_;
+    MyClass (): i_ (0) { }
+};
 
 
 int main ()
 {
-    return S<int>().bar ();
+    MyClass x;
+
+    return ExportedClass<MyClass>().exported_class_member (x).i_;
 }

Modified: incubator/stdcxx/trunk/etc/config/src/EXPORT_KEYWORD.cpp
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/etc/config/src/EXPORT_KEYWORD.cpp?rev=328919&r1=328918&r2=328919&view=diff
==============================================================================
--- incubator/stdcxx/trunk/etc/config/src/EXPORT_KEYWORD.cpp (original)
+++ incubator/stdcxx/trunk/etc/config/src/EXPORT_KEYWORD.cpp Thu Oct 27 11:02:59 2005
@@ -1,7 +1,11 @@
 // checking for the export keyword
 
-export template <class T>
-T foo (T t)
+
+// NOTE: test EXPORT.cpp links with EXPORT_KEYOWRD.o and expects
+// to find a definition of the function template below there
+export
+template <class T>
+T exported_function_template (T t)
 {
-    return T () + t;
+    return t;
 }



Mime
View raw message