help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [OT] Help with bisonc++(1)


From: Kip Warner
Subject: Re: [OT] Help with bisonc++(1)
Date: Sun, 30 Jul 2017 20:38:25 -0700

On Sat, 2017-07-29 at 00:43 +0200, Hans Åberg wrote:
> The untyped C++ parser is fine, as far as I know. There is a calc++
> example in the distribution which shows how to use locations for
> error reporting. The typed one may have a problem with the variants,
> but perhaps that can be fixed with std::variant of C++17, the latter
> which GCC supports, though there seems to be no developer right now.

Thanks Hans, but I reckon I'm too far down the bisonc++(1) rabbit hole
now.

I'm using bisonc++(1) 6.00.00. When I generate my parser and attempt to
compile it, I get a compiler warning for the second line of the
following method which appears to provide polymorphic support:

    template <Tag__ tg_>
    Semantic<tg_>::Semantic(Semantic<tg_> const &other)
    :
        d_data(other.d_data)
    {
        d_baseTag = other.d_baseTag;
    }

    warning: base class ‘class Meta__::Base’ should be explicitly
    initialized in the copy constructor [-Wextra]

I can of course suppress this warning, but I'd rather not. What I don't
understand is what the warning concerns since the Base class
Semantic<tg_> derives from only has a default constructor:

    class Base
    {
        protected:
            Tag__ d_baseTag;        // d_baseTag is assigned by Semantic.

        public:
            Base() = default;
            Base(B    ase const &other) = delete;

            virtual ~Base();

            Tag__ tag() const;
            Base *clone() const;
            void *data() const;        

        private:
            virtual Base *vClone() const = 0;
            virtual void *vData() const = 0;
    };

-- 
Kip Warner | Senior Software Engineer
OpenPGP signed/encrypted mail preferred
http://www.thevertigo.com

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]