Pike v7.8 release 350 running Hilfe v3.5 (Incremental Pike Frontend)
class c { int foo() { constant a = 17<<1; return a; } }; class c { int foo() { constant a = 17<<0; return a; } };
Compiler Error: 1: Constant definition is not constant.
Excuse me? Why is 17<<0 less constant than 17<<1?
Hmm... Seems the literal zero wasn't regarded as a constant... Try now (fixed in Pike 7.8 and 7.9).
The weird thing was that the problem only occurs with << and >>, not e.g. * or + or ^...
Yes, the main problem was in operators.c:may_have_side_effects(), which is AFAIK only used by the optimizers for `<<() and `>>().
pike-devel@lists.lysator.liu.se