Boost logo

Boost Users :

Subject: [Boost-users] [Spirit] qi::parse at translation unit global scope?
From: Olaf Meeuwissen (olaf.meeuwissen_at_[hidden])
Date: 2012-02-01 04:33:28


I noticed this when I played around with wrapping qi::parse() in a
parse() function that does some things before and after qi::parse().

My code had been calling qi::parse(), with the `qi::` namespace prefix,
everywhere so I removed from a few calls and compiled before adding a
parse() declaration. Lo and behold, compilation unexpectedly succeeded.
I've reduced the behaviour in a minimalistic sample program (attached).

I expect their to be *no* parse() function within the scope of main().
Can anyone clarify why the compiler has no trouble finding one and which
one it finds?

Adding a global scope operator to the call, i.e. saying ::parse(), does
result in the expected compile error.

Using Boost 1.46.1, gcc 4.6.2 on Debian wheezy.

Thanks in advance,

-- 
Olaf Meeuwissen, LPIC-2           FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962               Help support software freedom
                 http://www.fsf.org/jf?referrer=1962



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net