[cfe-commits] r148874 - in /cfe/trunk: lib/Sema/SemaExprCXX.cpp test/Analysis/reference.cpp

Chandler Carruth chandlerc at google.com
Sun Jan 29 15:12:20 PST 2012


On Sun, Jan 29, 2012 at 1:16 PM, Nico Weber <thakis at chromium.org> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120129/0da5b542/attachment.html>


More information about the cfe-commits mailing list