fork download
  1. namespace adl {
  2. struct foo {};
  3. void f(foo) {}
  4. }
  5.  
  6. struct base {
  7. void f(int) {}
  8. };
  9.  
  10. struct derived : base {
  11. void blah() {
  12. adl::foo obj = {};
  13. f(obj); // ADL greift hier nicht --> Fehler
  14. }
  15. };
  16.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In member function ‘void derived::blah()’:
prog.cpp:13:8: error: no matching function for call to ‘derived::f(adl::foo&)’
   f(obj); // ADL greift hier nicht --> Fehler
        ^
prog.cpp:13:8: note: candidate is:
prog.cpp:7:7: note: void base::f(int)
  void f(int) {}
       ^
prog.cpp:7:7: note:   no known conversion for argument 1 from ‘adl::foo’ to ‘int’
stdout
Standard output is empty