Ticket #1697: adl_barrier_broken.cpp

File adl_barrier_broken.cpp, 707 bytes (added by Shunsuke Sogame <pstade.mb@…>, 15 years ago)

failed example.

Line 
1#include <boost/detail/lightweight_test.hpp>
2#include <boost/noncopyable.hpp>
3
4namespace xxx {
5 namespace nested {
6 struct aaa {};
7 }
8 void begin(nested::aaa) {}
9}
10
11namespace nnn {
12 void begin(xxx::nested::aaa) {}
13}
14
15namespace boost {
16 template<class X>
17 void the_end(X &) {}
18}
19
20namespace my {
21 struct ccc : private boost::noncopyable {};
22 template<class X>
23 void the_end(X &) {}
24}
25
26int main()
27{
28 {
29 using namespace nnn;
30 xxx::nested::aaa a;
31 begin(a); // ambiguous error in msvc-9.0
32 }
33 {
34 my::ccc c;
35 the_end(c); // ambiguous error in msvc-9.0
36 }
37
38 return boost::report_errors();
39}