Invalid concept-checking code in V3

Mark Mitchell mark@codesourcery.com
Thu Jul 12 15:31:00 GMT 2001


The concept-checking code in V3 is invalid due to its use of this
pattern:

template <typename T>
class C {
  __glibcpp_class_requires (T, SomeConcept);
};

Here __glibcpp_class_requires is a macro that sometimes expands to
the empty string.  Then, you end up with:

template <typename T>
class C {
  ;
};

That's not valid; a member-declaration cannot consist of a single
`;'.  (I found this because the new parser did.  It's amzaing what
actually reading the spec as you implement code will do for you.)

The cleanest solution is probably to move the `;' into the
definition of the macro.

I'll file a PR as well.

-- 
Mark Mitchell                mark@codesourcery.com
CodeSourcery, LLC            http://www.codesourcery.com



More information about the Libstdc++ mailing list