Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <set>
- using namespace std;
- struct A {};
- struct X
- {
- template <typename T> void set(T x) {}
- };
- struct Y : X {};
- void f()
- {
- Y y;
- A a;
- y.set<A>(a);
- }
- /*
- $ clang++ -Wall -std=c++98 -c test.cpp
- test.cpp:19:4: warning: lookup of 'set' in member access expression is ambiguous; using member of 'Y' [-Wambiguous-member-template]
- y.set<A>(a);
- ^
- test.cpp:10:29: note: lookup in the object type 'Y' refers here
- template <typename T> void set(T x) {}
- ^
- In file included from test.cpp:2:
- In file included from /usr/include/c++/4.4/set:60:
- /usr/include/c++/4.4/bits/stl_set.h:87:11: note: lookup from the current scope refers here
- class set
- ^
- 1 warning generated.
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement