<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - After r360109, Assertion failed: (Chunk.Kind == DeclaratorChunk::Function), function VisitFunctionTypeLoc, file clang/lib/Sema/SemaType.cpp, line 5642."
   href="https://bugs.llvm.org/show_bug.cgi?id=43416">43416</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>After r360109, Assertion failed: (Chunk.Kind == DeclaratorChunk::Function), function VisitFunctionTypeLoc, file clang/lib/Sema/SemaType.cpp, line 5642.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>dimitry@andric.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>As reported in <a href="https://bugs.freebsd.org/240764">https://bugs.freebsd.org/240764</a>, clang 9.0.0 (and recent trunk)
give an assertion when compiling parts of VirtualBox:

Assertion failed: (Chunk.Kind == DeclaratorChunk::Function), function
VisitFunctionTypeLoc, file
/home/dim/src/llvm/trunk/tools/clang/lib/Sema/SemaType.cpp, line 5655.

#0  thr_kill () at thr_kill.S:3
#1  0x0000000804e2d934 in __raise (s=6) at /usr/src/lib/libc/gen/raise.c:52
#2  0x0000000804da0d99 in abort () at /usr/src/lib/libc/stdlib/abort.c:67
#3  0x0000000804e1d5c1 in __assert (func=<optimized out>, file=<optimized out>,
line=<optimized out>, failedexpr=<optimized out>) at
/usr/src/lib/libc/gen/assert.c:51
#4  0x00000000044abdd9 in ?? ()
#5  0x0000000004493e29 in ?? ()
#6  0x000000000448935b in clang::Sema::GetTypeForDeclarator(clang::Declarator&,
clang::Scope*) ()
#7  0x0000000003ec8630 in clang::Sema::HandleDeclarator(clang::Scope*,
clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>) ()
#8  0x0000000003ec823b in clang::Sema::ActOnDeclarator(clang::Scope*,
clang::Declarator&) ()
#9  0x0000000003cb9112 in
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) ()
#10 0x0000000003cb7e59 in
clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
()
#11 0x0000000003cb302c in
clang::Parser::ParseSimpleDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&, bool,
clang::Parser::ForRangeInit*, clang::SourceLocation*) ()
#12 0x0000000003cb2a33 in
clang::Parser::ParseDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&,
clang::SourceLocation*) ()
#13 0x0000000003c85944 in
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) ()
#14 0x0000000003c8401e in
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
()
#15 0x0000000003c7ed17 in clang::ParseAST(clang::Sema&, bool, bool) ()
#16 0x00000000033d9413 in clang::FrontendAction::Execute() ()
#17 0x0000000003352348 in
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) ()
#18 0x000000000347e8a5 in
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) ()
#19 0x00000000016696bc in cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) ()
#20 0x00000000016670d7 in main ()

This regressed with <a href="https://reviews.llvm.org/rL360109">https://reviews.llvm.org/rL360109</a> (Recommit r359859
"[Attribute/Diagnostics] Print macro if definition is an attribute
declaration").

Minimized test case:

// clang -cc1 -triple x86_64-- -S tstVMStructRC-min.cpp
#define a __attribute__((__cdecl__, __regparm__(0)))
int(a b)();</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>