[cfe-dev] C++ status report web page

Bill Wendling isanbard at gmail.com
Wed Jul 2 09:22:41 PDT 2008

Your comment is wrong for reinterpret_cast. You don't always cast  
from a pointer to a pointer. reinterpret_cast allows you to cast from  
a pointer to non-pointer, as long as the type cast to can hold the  
size of the pointer's value without loss of precision. So clang fails  
to emit an error in this situation:

$ cat t.cpp
#include <stdint.h>

void foo(int *f) {
   uintptr_t cp = reinterpret_cast<uintptr_t>(f);
   char c = reinterpret_cast<char>(f);
$ clang -fsyntax-only t.cpp
$ g++ -c t.cpp
t.cpp: In function 'void foo(int*)':
t.cpp:5: error: cast from 'int*' to 'char' loses precision

Please reference the patch I sent out many weeks ago for review. It  
didn't pass muster, but at least caught situations like this.


On Jul 2, 2008, at 4:45 AM, Argiris Kirtzidis wrote:

> Hi,
> After a suggestion by Chris, I've added a page to track C++ support in
> Clang:
> http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of- 
> Mon-20080630/006333.html
> Please feel free to add something I missed, change wording and/or  
> change
> the whole design of the page.
> Later I'll link to this page by the front page ("Current Status") and
> get_involved.html ("Open Projects"/"Continue work on C++ support").
> -Argiris
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

More information about the cfe-dev mailing list