<div dir="ltr">I've found that the GCC __attribute__((noreturn)) is part of the type, and not parsed into a separate AST node like the C++11 [[noreturn]] or the GNU __attribute__((analyzer_noreturn)).<div>To query the GCC __attribute__((noreturn)) we can use FunctionType::getNoReturnAttr().</div><div><br></div><div>Why do we have these differences, with these attributes, why was the GCC noreturn uplifted into the Type?</div><div><br></div><div>Thanks,</div><div>Gabor</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 4, 2019 at 11:40 AM Gábor Márton <<a href="mailto:martongabesz@gmail.com">martongabesz@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<br><div><br></div><div>Having a source file (/tmp/attr.cpp)</div><div>  void f() __attribute__((analyzer_noreturn));<br>  void g() __attribute__((noreturn));<br>  [[gnu::noreturn]] void h(void);<br></div><div>Generates the following AST, when clang -cc1 -ast-dump /tmp/attr.cpp is used</div><div>  |-FunctionDecl 0x18a5178 </tmp/attr.cpp:1:1, col:43> col:6 f 'void ()'<br>  | `-AnalyzerNoReturnAttr 0x18a5218 <col:25><br>  |-FunctionDecl 0x18a5308 <line:2:1, col:34> col:6 g 'void () __attribute__((noreturn))'<br>  `-FunctionDecl 0x18a5440 <line:3:19, col:30> col:24 h 'void () __attribute__((noreturn))'<br></div><div><br></div><div>I.e. the NoReturnAttr node is missing. This is very confusing, when compared to the AnalyzerNoReturnAttr, which is there.</div><div>The only difference in Attr.td is that noreturn has GCC spelling, while analyzer_noreturn has GNU spelling.</div><div>What am I missing to have a NoReturnAttr node? Do I have to specify a special extra flag for CC1 to enable GCC attributes?</div><div><br></div><div>Thanks,</div><div>Gabor</div></div>
</blockquote></div>