
28 Jan
2009
28 Jan
'09
3:55 p.m.
"Eric Niebler"
You're passing an expression to a grammar to be evaluated with its transforms. That expression must match the grammar. It's undefined behavior if it doesn't, and in this case, it doesn't. "Performing the transform" falls withing UB.
It would be possible to add a compile-time check to all grammars function call operators to catch this error, but that comes with a compile-time cost.
I think it would be a useful check. Could you either (1) always check in proto::exact (2) check when a compile time flag is defined