Some code cleanup, reorganization of diagnostic.
A little hack to use clang contexpr mechanism to evaluate expression of for statement condition.