fork download
  1. typedef int eventid;
  2. namespace test
  3. {
  4. typedef float eventid;
  5.  
  6. }
  7.  
  8. using namespace test;
  9. int main()
  10. {
  11. eventid test0 = 3.14;
  12. ::eventid test1 = 3.14;
  13. test::eventid test2 = 3.14;
  14. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:11:5: error: reference to ‘eventid’ is ambiguous
     eventid test0 = 3.14;
     ^~~~~~~
prog.cpp:1:13: note: candidates are: typedef int eventid
 typedef int eventid;
             ^~~~~~~
prog.cpp:4:19: note:                 typedef float test::eventid
     typedef float eventid;
                   ^~~~~~~
stdout
Standard output is empty