[Bug c++/60345] [4.9 Regression] r208159 causes Firefox build error

trippels at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Feb 26 14:07:00 GMT 2014


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60345

--- Comment #2 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
markus@x4 src % cat test.ii
class A {};
template <typename T> class Handle : A {
public:
  operator T &();
};

class JSAtom {};
class PropertyName : public JSAtom {};
template <typename K, typename, int> class InlineMap {
public:
  void remove(const K &);
};
class DefinitionSingle;
template <class Map> struct AtomThingMapPtr {
  Map *operator->();
};
template <typename AtomThingMapPtrT> class D : public AtomThingMapPtrT {};

struct B : AtomThingMapPtr<InlineMap<JSAtom *, DefinitionSingle, 0> > {};
class TokenStream;
class ParseNode {};
struct Definition : ParseNode {
  enum Kind {};
};
class FullParseHandler {
public:
  typedef ParseNode *Node;
};
struct C {};
template <typename> struct ParseContext : C {
  bool define(TokenStream &, Handle<PropertyName *>, FullParseHandler::Node,
              Definition::Kind);
  D<B> lexdeps;
};
template <>
bool ParseContext<FullParseHandler>::define(TokenStream &,
                                            Handle<PropertyName *> name,
                                            ParseNode *, Definition::Kind) {
  lexdeps->remove(name);
}


markus@x4 src % g++ -std=gnu++0x -c test.ii
test.ii: In member function ‘bool ParseContext< <template-parameter-1-1>
>::define(TokenStream&, Handle<PropertyName*>, FullParseHandler::Node,
Definition::Kind) [with <template-parameter-1-1> = FullParseHandler;
FullParseHandler::Node = ParseNode*]’:
test.ii:39:23: error: no matching function for call to ‘InlineMap<JSAtom*,
DefinitionSingle, 0>::remove(Handle<PropertyName*>&)’
   lexdeps->remove(name);
                       ^
test.ii:39:23: note: candidate is:
test.ii:11:8: note: void InlineMap<K, <template-parameter-1-2>, <anonymous>
>::remove(const K&) [with K = JSAtom*; <template-parameter-1-2> =
DefinitionSingle; int <anonymous> = 0]
   void remove(const K &);
        ^
test.ii:11:8: note:   no known conversion for argument 1 from
‘Handle<PropertyName*>’ to ‘JSAtom* const&’


More information about the Gcc-bugs mailing list