From 6490aee1b8a27e3c9bdf441eb0ee4964a9cfa1fb Mon Sep 17 00:00:00 2001 From: Geert-Jan Giezeman Date: Mon, 13 Sep 1999 11:01:26 +0000 Subject: [PATCH] new test program --- .../config/testfiles/CGAL_CFG_TYPENAME_BUG.C | 46 +++++++++++++++++++ .../Configuration/CGAL_CFG_TYPENAME_BUG.C | 46 +++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 Packages/Configuration/config/testfiles/CGAL_CFG_TYPENAME_BUG.C create mode 100644 Packages/Configuration/test/Configuration/CGAL_CFG_TYPENAME_BUG.C diff --git a/Packages/Configuration/config/testfiles/CGAL_CFG_TYPENAME_BUG.C b/Packages/Configuration/config/testfiles/CGAL_CFG_TYPENAME_BUG.C new file mode 100644 index 00000000000..b76f7d35292 --- /dev/null +++ b/Packages/Configuration/config/testfiles/CGAL_CFG_TYPENAME_BUG.C @@ -0,0 +1,46 @@ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : +// +// file : config/testfiles/CGAL_CFG_TYPENAME_BUG.C +// author(s) : various +// +// coordinator : Utrecht University +// +// ====================================================================== + +// CGAL_CFG_TYPENAME_BUG.C +// --------------------------------------------------------------------- +// A short test program to evaluate a C++ compiler. +// This program is used by cgal_configure. +// The following documentation will be pasted in the generated configfile. +// --------------------------------------------------------------------- + +//| If a compiler complains about typename, when passing a dependent +//| type as template parameter, the flag CGAL_CFG_TYPENAME_BUG is set. + +template < class T > struct Zap {}; + +struct TT { typedef int O; }; + +template < class T > +void foo(T) +{ + typedef Zap< typename T::O > O; +} + +int main() +{ + TT t; + foo(t); + return 0; +} + diff --git a/Packages/Configuration/test/Configuration/CGAL_CFG_TYPENAME_BUG.C b/Packages/Configuration/test/Configuration/CGAL_CFG_TYPENAME_BUG.C new file mode 100644 index 00000000000..b76f7d35292 --- /dev/null +++ b/Packages/Configuration/test/Configuration/CGAL_CFG_TYPENAME_BUG.C @@ -0,0 +1,46 @@ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : +// +// file : config/testfiles/CGAL_CFG_TYPENAME_BUG.C +// author(s) : various +// +// coordinator : Utrecht University +// +// ====================================================================== + +// CGAL_CFG_TYPENAME_BUG.C +// --------------------------------------------------------------------- +// A short test program to evaluate a C++ compiler. +// This program is used by cgal_configure. +// The following documentation will be pasted in the generated configfile. +// --------------------------------------------------------------------- + +//| If a compiler complains about typename, when passing a dependent +//| type as template parameter, the flag CGAL_CFG_TYPENAME_BUG is set. + +template < class T > struct Zap {}; + +struct TT { typedef int O; }; + +template < class T > +void foo(T) +{ + typedef Zap< typename T::O > O; +} + +int main() +{ + TT t; + foo(t); + return 0; +} +