xeus-cling icon indicating copy to clipboard operation
xeus-cling copied to clipboard

using std a posteriori does not fix endl lookup

Open nthiery opened this issue 7 years ago • 4 comments

If one forgets to "use std" before accessing "endl", then "using namespace std" a posteriori does not resolve the lookup:

In[1] cout << 1 << endl;

input_line_7:2:2: error: use of undeclared identifier 'cout'; did you mean 'std::cout'?
 cout << 1 << endl;
 ^~~~
...

All good for now.

In[2] using namespace std;

One would now expect the following to work, but it does not:

In[3] cout << 1 << endl;

input_line_9:2:15: error: reference to overloaded function could not be resolved; did you mean to call it?
 cout << 1 << endl;
              ^~~~
...

Full transcript in test-namespace-endl.pdf

nthiery avatar Sep 30 '17 10:09 nthiery

It's a cling issue. I will test on the last version of cling to be sure that this issue was not already solved.

gouarin avatar Sep 30 '17 11:09 gouarin

cc @vgvassilev this is an upstream issue apparently. Might be solved in 0.4

SylvainCorlay avatar Oct 18 '17 14:10 SylvainCorlay

For the record: the issue is still there with cling 0.5:

clangdev                  5.0.0                   cling_1  [cling]  gouarin
cling                     0.5                           3  [cling]  gouarin
cling-patches             1                             0    QuantStack
clingkernel               0.0.2                     <pip>
cppzmq                    4.2.2                   cling_0  [cling]  gouarin
llvmdev                   5.0.0                   cling_1  [cling]  gouarin
xeus-cling                0.0.10                        0    gouarin
zeromq                    4.2.3                   cling_3  [cling]  gouarin

nthiery avatar Jan 23 '18 16:01 nthiery

the issue is still there with cling 0.7 and xeus-cling 0.10

ghost avatar Nov 01 '20 06:11 ghost