Displaying 2 results from an estimated 2 matches for "alwaysfalse".
2017 Jun 30
3
The undef story
...o_something_2();
template <typename T>
int do_something(T mask, bool cond) {
if (mask & 2)
return 42;
if (cond) {
T high_mask = mask >> 48;
if (high_mask > 5)
do_something_1(high_mask);
else
do_something_2();
}
return 0;
}
char foo();
bool alwaysfalse();
char f = do_something<char>(foo(), alwaysfalse());
> On Jun 29, 2017, at 2:49 PM, Mehdi AMINI <joker.eph at gmail.com> wrote:
>
>
>
> 2017-06-29 14:32 GMT-07:00 Peter Lawrence <peterl95124 at sbcglobal.net <mailto:peterl95124 at sbcglobal.net>>:
&g...
2017 Jun 29
6
The undef story
Mehdi,
I think the following was the point of the conversation,
That both those examples are illegal C programs.
They are both “undefined behavior” because they both
use a shift amount that is too large.
They both should have been rejected by the compiler
even though they weren’t.
Hal agrees wth this assessment,
That’s why we’re waiting for a more complete example.
My belief is that