On Sun, Jan 29, 2012 at 1:16 PM, Nico Weber <[email protected]> wrote:

> Chandler / Matthieu: I tried that - it gets rid of the copy
> constructor error, but since the volatile is casted away, the
> Wnull-dereference warning reappears.


Sorry I had a typo in my example, but we did in fact place the const cast
on the reference, not on the pointer. That is what silences the warning:

return const_cast<typename
remove_reference<T>::type&>(*static_cast<volatile typename
remove_reference<T>::type*>(0));

(I had the '*' in the wrong place last time)

Anyways, I'll try out the abort variation. I do like that much more.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to