Opened 7 years ago

#6070 new Bugs

extends::operator() and operator= eagerly compute return type can result in hard error

Reported by: Eric Niebler Owned by: Eric Niebler
Milestone: Boost 1.48.0 Component: proto
Version: Boost 1.47.0 Severity: Problem
Keywords: Cc:


In the cases when unary operator() and operator= are invalid in a particular domain, the return types of extends::operator() and operator= should not be computed. (Well, ideally, those functions shouldn't exist at all, but we live in an imperfect world.) Trouble is, as soon as the extends template is instantiated, the return types for those functions are eagerly computed, causing the generator to operate on a type that it may not be able to handle. This can cause a hard error.

See for a full description of this issue.

The attached patch addresses the issue. It may have compile time implications, though.

Attachments (1)

unary_function.patch (57.8 KB) - added by Eric Niebler 7 years ago.
patch against trunk to address the issue

Download all attachments as: .zip

Change History (1)

Changed 7 years ago by Eric Niebler

Attachment: unary_function.patch added

patch against trunk to address the issue

Note: See TracTickets for help on using tickets.