Ticket #6331: test_boost_test_decorator_enable_if.cpp

File test_boost_test_decorator_enable_if.cpp, 2.7 KB (added by t0rt1e@…, 11 years ago)

test case

Line 
1/*
2 * test_boost_test_decorator_enable_if -- Test case exposing
3 * compilation problem with g++ (not clang++) against Boost trunk
4 * svn rev. <=76217 (after 1.48.0 release) due to ambiguity between
5 * template<class Cond, class T> struct boost::enable_if and class
6 * boost::unit_test::decorator::enable_if in
7 * boost/typeof/native.hpp.
8 *
9 * Copyright (C) 2011 Torsten Maehne
10 *
11 * Distributed under the Boost Software License, Version 1.0.
12 * (See accompanying file LICENSE_1_0.txt or copy at
13 * http://www.boost.org/LICENSE_1_0.txt)
14 */
15
16/*!
17 * \file test_boost_test_decorator_enable_if.cpp
18 *
19 * \brief Test case exposing compilation problem with g++ (not
20 * clang++) against Boost trunk svn rev. <=76217 (after
21 * 1.48.0 release) due to ambiguity between template<class
22 * Cond, class T> struct boost::enable_if and class
23 * boost::unit_test::decorator::enable_if in
24 * boost/typeof/native.hpp.
25 *
26 * This test case compiles correctly against Boost 1.48.0 using Apple
27 * g++ 4.2.1, MacPorts g++ 4.5.3 and 4.6.2 as well as Apple clang++
28 * 3.0 on Mac OS X Lion 10.7.2 and Xcode 4.2.1.
29 *
30 * It fails to compile against Boost trunk until at least svn
31 * rev. 76217 using any of the mentioned g++ versions. Surprisingly,
32 * clang++ 3.0 is still able to correctly compile the test case.
33 *
34 * This test case is derived from
35 * test_signed_integer_output_with_karma.cpp in Trac ticket #6126
36 * <https://svn.boost.org/trac/boost/ticket/6126>. During the
37 * discussion of ticket #6126 on the Boost-Spirit-general mailing
38 * list, Jeroen Habraken identified the header
39 * boost/test/tree/decorator.hpp as the origin for the compilation
40 * failure of the test case agains Boost trunk. He found the cause to
41 * be an ambiguity:
42 *
43 * boost/typeof/native.hpp:30:9: error: reference to 'enable_if' is ambiguous
44 * boost/utility/enable_if.hpp:36:10: error: candidates are:
45 * template<class Cond, class T> struct boost::enable_if and
46 * class boost::unit_test::decorator::enable_if
47 *
48 * As enable_if is often used without being fully qualified this
49 * breaks in a major fashion. Since boost/test/tree/decorator.hpp seems
50 * to be quite new (added 2011-10-02 11:00:16 +0200) it might be best
51 * fixed there.
52 *
53 * For details, please cf. to:
54 * <http://sourceforge.net/mailarchive/forum.php?thread_name=CAGCnmH11u2%2Bvfef9v8YpPnbv1cN%3Da5Px2xSu%3DKTnaKBve2vTwQ%40mail.gmail.com&forum_name=spirit-general>
55 *
56 * \author Torsten Maehne
57 * \date 2011-12-29
58 * \version $Id$
59 */
60#define BOOST_TEST_MODULE test_boost_test_decorator_enable_if
61#include <boost/test/included/unit_test.hpp>
62#include <boost/typeof/native.hpp>
63
64//! \test Dummy test.
65BOOST_AUTO_TEST_CASE(test_dummy)
66{
67 // do nothing
68}