[cfe-dev] C++ Language Support Library

Eli Friedman eli.friedman at gmail.com
Sun Nov 9 22:01:28 PST 2008


On Sun, Nov 9, 2008 at 2:00 PM, Argiris Kirtzidis <akyrtzi at gmail.com> wrote:
> Eli Friedman wrote:
>>
>> On Sun, Nov 9, 2008 at 11:48 AM, Argiris Kirtzidis <akyrtzi at gmail.com>
>> wrote:
>>
>>>
>>> Eli Friedman wrote:
>>>
>>>>
>>>> All right, so ignoring the concept stuff, all we need is type_info,
>>>> nullptr_t, and maybe a few of the exception types depending on the
>>>> implementation.  I'd say just add them to the ASTContext.
>>>>
>>>>
>>>
>>> Sema also needs to track whether std::type_info has been defined or not.
>>> We could always add a 'std' namespace and a 'class typeinfo' forward
>>> reference and check whether the 'typeinfo' RecordDecl is defined, but it
>>> seems a bit wasteful to always declare them.
>>>
>>
>> How do the headers define typeinfo?  If it isn't something like
>> "typedef __builtin_typeinfo typeinfo;", it's going to be a pain to
>> deal with...
>>
>
> They define it as a class.

Oh, I didn't realize that per [expr.typeid], "If the header <typeinfo>
(18.6.1) is not included prior to a use of typeid, the program is
ill-formed."

Is there something wrong with having Sema just look up the identifier
"std::type_info" when it's processing a typeid?

-Eli



More information about the cfe-dev mailing list