Closed Daniel-Cortez closed 3 years ago
Rebased to the latest changes from #602.
Implemented a new mechanism that allows to record tokens read by function lex()
. With this, __static_assert
and __static_check
can now properly display multi-line expressions in error/warning messages.
What this PR does / why we need it:
Implements operators
__static_assert
and__static_check
using @YashasSamaga's implementation as a base (see #300).The most notable differences from the original implementation are:
do_static_check()
reuses the standard string parsing mechanism for the optional 2'nd argument, in the same manner as operator__pragma
does.__static_check
and__static_assert
return abool:
-tagged result.would be ambiguous, as there will be no way to tell if it should be treated as
__static_assert(1), __static_assert(2);
or__static_assert(1, __static_assert(2));
.Which issue(s) this PR fixes:
Fixes #294
What kind of pull this is:
Additional Documentation:
This PR is built upon the changes from #602, so you'll want to review and merge that PR first.