This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/20647] Wrong typeid for incomplete types



------- Comment #6 from frederic dot riss at gmail dot com  2005-11-06 16:33 -------
I nearly forgot that I submitted this bug report... 
I got myself a version of the C++ standard since I submitted that, and I just
had a look at the part describing typeid :

5.2.8.4 reads : "When typeid is applied to a <i>type-id</i>, [...]. If the type
of the type-id is a class type or a reference to a class type, the class shall
be completely-defined."

I believe A* in 2.C qualifies a a reference to a not-completely defined class
type, and thus shouldn't be passed to std::typeid. 

I'm not an expert in standard reading, but it seems to me that the current
behaviour isn't really a bug. If possible, I would be glad to see a warning
emited by GCC in that case, because I hit that problem in real-world code
(generic callback system using boost::any behind the scenes) and I spent hours
finding out what was happening. Maybe I should suggest adding a concept check
to the boost code if it is possible to detect it.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20647


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]