Bug 205866 - boost::spirit generates warnings
Summary: boost::spirit generates warnings
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: boost
Version: 5
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Benjamin Kosnik
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-09-09 03:36 UTC by Darren Cook
Modified: 2013-08-09 05:48 UTC (History)
1 user (show)

Fixed In Version: 1.33.1-9
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-11-20 17:40:22 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Darren Cook 2006-09-09 03:36:22 UTC
Description of problem:

When compiling with -Wshadow I get complaints. The error messages, and the code
fixes are shown below.

Additional info:

/usr/include/boost/spirit/core/non_terminal/impl/rule.ipp:227: warning:
declaration of 'p' shadows a member of 'this'

BEFORE:
            concrete_parser(ParserT const& p) : p(p) {}

AFTER:
            concrete_parser(ParserT const& p_) : p(p_) {}



/usr/include/boost/spirit/core/impl/match.ipp:24: warning: declaration of
'length' shadows a member of 'this'

BEFORE:
    template <typename T>
    inline match<T>::match(std::size_t length, ctor_param_t val_)
    : len(length), val(val_) {}

AFTER:
    template <typename T>
    inline match<T>::match(std::size_t length_, ctor_param_t val_)
    : len(length_), val(val_) {}



/usr/include/boost/spirit/core/scanner/scanner.hpp:243: warning: declaration of
'iteration_policy_t' shadows a member of 'this'

From line 240, BEFORE:
        bool
        at_end() const
        {
            typedef typename PoliciesT::iteration_policy_t iteration_policy_t;
            return iteration_policy_t::at_end(*this);
        }

        value_t
        operator*() const
        {
            typedef typename PoliciesT::iteration_policy_t iteration_policy_t;
            return iteration_policy_t::filter(iteration_policy_t::get(*this));
        }

        scanner const&
        operator++() const
        {
            typedef typename PoliciesT::iteration_policy_t iteration_policy_t;
            iteration_policy_t::advance(*this);
            return *this;
        }


AFTER:
        bool
        at_end() const
        {
            return PoliciesT::iteration_policy_t::at_end(*this);
        }

        value_t
        operator*() const
        {
            return
PoliciesT::iteration_policy_t::filter(PoliciesT::iteration_policy_t::get(*this));
        }

        scanner const&
        operator++() const
        {
            PoliciesT::iteration_policy_t::advance(*this);
            return *this;
        }

Comment 1 Benjamin Kosnik 2006-11-13 11:06:54 UTC
Fix pending. It would be great to get a simple test case that I could use to
verify patch.

Also, note that this is still not fixed upstream. I'll ping the boost list for
you about this, with your patch.

-benjamin

Comment 2 Benjamin Kosnik 2006-11-20 17:40:22 UTC
Modulo scanner.hpp patch.


Note You need to log in before you can comment on or make changes to this bug.