<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Jun 20, 2013, at 6:31 PM, Nico Weber <<a href="mailto:thakis@chromium.org">thakis@chromium.org</a>> wrote:</div><blockquote type="cite"><div dir="ltr">On Thu, Jun 20, 2013 at 4:43 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="h5">On Thu, Jun 20, 2013 at 4:30 PM, Nico Weber <<a href="mailto:nicolasweber@gmx.de">nicolasweber@gmx.de</a>> wrote:<br>

> Author: nico<br>
> Date: Thu Jun 20 18:30:30 2013<br>
> New Revision: 184498<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=184498&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=184498&view=rev</a><br>
> Log:<br>
> Fix a crash with __flaot128 noticed by Eli.<br>
><br>
><br>
> Modified:<br>
>     cfe/trunk/lib/AST/ASTContext.cpp<br>
>     cfe/trunk/test/Sema/128bitfloat.cc<br>
><br>
> Modified: cfe/trunk/lib/AST/ASTContext.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=184498&r1=184497&r2=184498&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=184498&r1=184497&r2=184498&view=diff</a><br>

> ==============================================================================<br>
> --- cfe/trunk/lib/AST/ASTContext.cpp (original)<br>
> +++ cfe/trunk/lib/AST/ASTContext.cpp Thu Jun 20 18:30:30 2013<br>
> @@ -859,12 +859,12 @@ TypedefDecl *ASTContext::getUInt128Decl(<br>
><br>
>  TypeDecl *ASTContext::getFloat128StubType() const {<br>
>    if (!Float128StubDecl) {<br>
> -    Float128StubDecl = RecordDecl::Create(const_cast<ASTContext &>(*this),<br>
> -                                          TTK_Struct,<br>
> -                                          getTranslationUnitDecl(),<br>
> -                                          SourceLocation(),<br>
> -                                          SourceLocation(),<br>
> -                                          &Idents.get("__float128"));<br>
> +    Float128StubDecl = CXXRecordDecl::Create(const_cast<ASTContext &>(*this),<br>
> +                                             TTK_Struct,<br>
> +                                             getTranslationUnitDecl(),<br>
> +                                             SourceLocation(),<br>
> +                                             SourceLocation(),<br>
> +                                             &Idents.get("__float128"));<br>
<br>
</div></div>Maybe assert getLangOpts().CPlusPlus before creating a CXXRecordDecl?<br></blockquote><div><br></div><div>Sure, why not :-) r184516.</div></div></div></div></blockquote><div><br></div>Is this profoundly C++-specific for some reason?  There's already a CreateRecordDecl helper routine in ASTContext.cpp for creating the appropriate variety of record.</div><div><br></div><div>John.</div></body></html>