bison-patches
[Top][All Lists]
Advanced

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

Bug: duplicate c++ constructors


From: Valentin Tolmer
Subject: Bug: duplicate c++ constructors
Date: Sun, 28 Jul 2013 13:41:20 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7

Hello,

After working on a patch about symbol aliases, I got a very unexpected bug:
when running make check, the generated examples/calc++/calc++-parser.hh has duplicate definitions for the basic_symbol. Around line 317, I get


  basic_symbol (typename Base::kind_type t, const location_type& l);

basic_symbol (typename Base::kind_type t, const std::string v, const location_type& l);

basic_symbol (typename Base::kind_type t, const int v, const location_type& l);

  basic_symbol (typename Base::kind_type t, const location_type& l);

basic_symbol (typename Base::kind_type t, const int v, const location_type& l);

  basic_symbol (typename Base::kind_type t, const location_type& l);


And around line 790, the corresponding implementations :


  // Implementation of basic_symbol constructor for each type.

  template <typename Base>
calcxx_parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const location_type& l)
    : Base (t)
    , value ()
    , location (l)
  {}

  template <typename Base>
calcxx_parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const std::string v, const location_type& l)
    : Base (t)
    , value (v)
    , location (l)
  {}

  template <typename Base>
calcxx_parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const int v, const location_type& l)
    : Base (t)
    , value (v)
    , location (l)
  {}

  template <typename Base>
calcxx_parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const location_type& l)
    : Base (t)
    , value ()
    , location (l)
  {}

  template <typename Base>
calcxx_parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const int v, const location_type& l)
    : Base (t)
    , value (v)
    , location (l)
  {}

  template <typename Base>
calcxx_parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const location_type& l)
    : Base (t)
    , value ()
    , location (l)
  {}


The nature of my patch is basically this: instead of having duplicate information in symbols and their aliases, and to be forced to resolve the differences later, the symbols now contain only their intrinsic information (name, location), and share with the alias a pointer to a structure containing the rest (precedence, etc...).

If you have a clue as to what is causing this bug, please tell me. Otherwise, if you could at least point me to the place in the code where the file is generated, I'd be grateful.

Thanks!

Valentin Tolmer



reply via email to

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