This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Invalid concept-checking code in V3


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]