2 * This program checks if the compiler doesn't have a certain bug
3 * that we encountered when testing C++11 features
6 #include "test_config.h"
19 using ref_type
= o_r
<T
>;
24 typename
= typename
std::enable_if
<
25 std::is_base_of
<T_base
, T
>::value
>::type
, typename
...Args
>
26 o_r
<T
> make_f(Args
&& ...args
);
32 template <typename _Tp1
, typename
, typename
...Args
>
33 friend o_r
<_Tp1
> make_f(Args
&& ...args
);
35 using shared_ptr_type
= std::shared_ptr
<T
>;
36 template<typename _Tp1
, typename
= typename
37 std::enable_if
<std::is_convertible
<_Tp1
*, T
*>::value
>::type
>
42 shared_ptr_type stub_
;
45 template<typename T
, typename
, typename
...Args
>
46 inline o_r
<T
> make_f(Args
&& ...args
)
48 return o_r
<T
> (new T (std::forward
<Args
> (args
)...));
51 class A
: public T_base
55 template <typename _Tp1
, typename
, typename
...Args
>
56 friend o_r
<_Tp1
> make_f(Args
&& ...args
);
59 o_t
<A
>::ref_type
create ()
68 run_main (int, ACE_TCHAR
*[])
70 ACE_START_TEST (ACE_TEXT("Compiler_Features_24_Test"));
72 FOO::o_r
<FOO::A
> l
= FOO::create();
74 FOO::o_r
<FOO::A
> l2
= FOO::make_f
<FOO::A
>();
75 // next line doesn't compile and shouldn't
76 //FOO::o_r<FOO::B> l3 = FOO::make_f<FOO::B>();
79 ACE_TEXT ("Compiler Feature 24 Test does compile and run.\n")));