<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - crash during name mangling of overloadable function with parameter type pointer-to-incomplete-struct"
   href="https://llvm.org/bugs/show_bug.cgi?id=25836">25836</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>crash during name mangling of overloadable function with parameter type pointer-to-incomplete-struct
          </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>Linux
          </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>LLVM Codegen
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>dgross@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=15454" name="attach_15454" title="preprocessed source">attachment 15454</a> <a href="attachment.cgi?id=15454&action=edit" title="preprocessed source">[details]</a></span>
preprocessed source

To reproduce:
% cat junk.c
static void __attribute__((overloadable)) aiAccum(struct A *a, int b) { }
% clang -c junk.c

Result:
junk.c:1:58: warning: declaration of 'struct A' will not be visible outside of
this function [-Wvisibility]
static void __attribute__((overloadable)) aiAccum(struct A *a, int b) { }
                                                         ^
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.8.0 (<a href="http://llvm.org/git/clang.git">http://llvm.org/git/clang.git</a>
87a1c47cfd870a22a67068d03007a260458392ea) (<a href="http://llvm.org/git/llvm.git">http://llvm.org/git/llvm.git</a>
f730abdc9da305a1af78459b62143e4904047522)
Target: x86_64-unknown-linux-gnu
Thread model: posix

Beginning of stack trace:
0x0000000002cd8a05 in clang::LinkageInfo::LinkageInfo (this=0x7fffff7ff080,
L=clang::InternalLinkage, V=clang::DefaultVisibility, E=<error reading
variable: Cannot access memory at address 0x7fffff7feffc>) at
/media/dgross/ssd01/git/llvm/tools/clang/lib/AST/../../include/clang/Basic/Visibility.h:60
60        LinkageInfo(Linkage L, Visibility V, bool E)
#0  0x0000000002cd8a05 in clang::LinkageInfo::LinkageInfo (this=0x7fffff7ff080,
L=clang::InternalLinkage, V=clang::DefaultVisibility, E=<error reading
variable: Cannot access memory at address 0x7fffff7feffc>) at
/media/dgross/ssd01/git/llvm/tools/clang/lib/AST/../../include/clang/Basic/Visibility.h:60
#1  0x0000000002cdd5da in clang::LinkageComputer::getLVForDecl (D=0x7dc42d0,
computation=LVForLinkageOnly) at
/media/dgross/ssd01/git/llvm/tools/clang/lib/AST/Decl.cpp:1318
#2  0x0000000002cdd813 in getLVForDecl (D=0x7dc42d0,
computation=LVForLinkageOnly) at
/media/dgross/ssd01/git/llvm/tools/clang/lib/AST/Decl.cpp:1357
#3  0x0000000002cdc9d5 in clang::NamedDecl::getLinkageInternal (this=0x7dc42d0)
at /media/dgross/ssd01/git/llvm/tools/clang/lib/AST/Decl.cpp:1030
#4  0x0000000001bdabd6 in clang::NamedDecl::hasExternalFormalLinkage
(this=0x7dc42d0) at
/media/dgross/ssd01/git/llvm/tools/clang/lib/Sema/../../include/clang/AST/Decl.h:276
#5  0x0000000002ce8331 in getDeclLanguageLinkage<clang::FunctionDecl> (D=...)
at /media/dgross/ssd01/git/llvm/tools/clang/lib/AST/Decl.cpp:1840
#6  0x0000000002ce1a1c in clang::FunctionDecl::getLanguageLinkage
(this=0x7dc42d0) at
/media/dgross/ssd01/git/llvm/tools/clang/lib/AST/Decl.cpp:2534
#7  0x0000000002ce8432 in isDeclExternC<clang::FunctionDecl> (D=...) at
/media/dgross/ssd01/git/llvm/tools/clang/lib/AST/Decl.cpp:1874
#8  0x0000000002ce1a36 in clang::FunctionDecl::isExternC (this=0x7dc42d0) at
/media/dgross/ssd01/git/llvm/tools/clang/lib/AST/Decl.cpp:2538
#9  0x0000000002db0625 in (anonymous namespace)::getEffectiveDeclContext
(D=0x7dc42d0) at
/media/dgross/ssd01/git/llvm/tools/clang/lib/AST/ItaniumMangle.cpp:77
#10 0x0000000002db23f6 in (anonymous
namespace)::CXXNameMangler::mangleUnqualifiedName (this=0x7fffffffa0f0,
ND=0x7dc42d0, Name=..., KnownArity=4294967295) at
/media/dgross/ssd01/git/llvm/tools/clang/lib/AST/ItaniumMangle.cpp:942
#11 0x0000000002db0ea0 in (anonymous
namespace)::CXXNameMangler::mangleUnqualifiedName (this=0x7fffffffa0f0,
ND=0x7dc42d0) at
/media/dgross/ssd01/git/llvm/tools/clang/lib/AST/ItaniumMangle.cpp:343
#12 0x0000000002db184e in (anonymous
namespace)::CXXNameMangler::mangleUnscopedName (this=0x7fffffffa0f0,
ND=0x7dc42d0) at
/media/dgross/ssd01/git/llvm/tools/clang/lib/AST/ItaniumMangle.cpp:647
#13 0x0000000002db170c in (anonymous namespace)::CXXNameMangler::mangleName
(this=0x7fffffffa0f0, ND=0x7dc42d0) at
/media/dgross/ssd01/git/llvm/tools/clang/lib/AST/ItaniumMangle.cpp:616
#14 0x0000000002db11aa in (anonymous
namespace)::CXXNameMangler::mangleFunctionEncoding (this=0x7fffffffa0f0,
FD=0x7dc42d0) at
/media/dgross/ssd01/git/llvm/tools/clang/lib/AST/ItaniumMangle.cpp:476
#15 0x0000000002db2d73 in (anonymous
namespace)::CXXNameMangler::mangleLocalName (this=0x7fffffffa0f0, D=0x7d79788)
at /media/dgross/ssd01/git/llvm/tools/clang/lib/AST/ItaniumMangle.cpp:1159
#16 0x0000000002db1666 in (anonymous namespace)::CXXNameMangler::mangleName
(this=0x7fffffffa0f0, ND=0x7d79788) at
/media/dgross/ssd01/git/llvm/tools/clang/lib/AST/ItaniumMangle.cpp:601
#17 0x0000000002db580a in (anonymous namespace)::CXXNameMangler::mangleType
(this=0x7fffffffa0f0, T=0x7d79810) at
/media/dgross/ssd01/git/llvm/tools/clang/lib/AST/ItaniumMangle.cpp:2111
#18 0x0000000002db57d9 in (anonymous namespace)::CXXNameMangler::mangleType
(this=0x7fffffffa0f0, T=0x7d79810) at
/media/dgross/ssd01/git/llvm/tools/clang/lib/AST/ItaniumMangle.cpp:2108
#19 0x0000000002db4f28 in (anonymous namespace)::CXXNameMangler::mangleType
(this=0x7fffffffa0f0, T=...) at
/media/dgross/ssd01/git/llvm/tools/clang/lib/AST/../../include/clang/AST/TypeNodes.def:91
#20 0x0000000002db5b31 in (anonymous namespace)::CXXNameMangler::mangleType
(this=0x7fffffffa0f0, T=0x7dc40d0) at
/media/dgross/ssd01/git/llvm/tools/clang/lib/AST/ItaniumMangle.cpp:2187
#21 0x0000000002db4d00 in (anonymous namespace)::CXXNameMangler::mangleType
(this=0x7fffffffa0f0, T=...) at
/media/dgross/ssd01/git/llvm/tools/clang/lib/AST/../../include/clang/AST/TypeNodes.def:64
#22 0x0000000002db5714 in (anonymous
namespace)::CXXNameMangler::mangleBareFunctionType (this=0x7fffffffa0f0,
T=0x7dc4260, MangleReturnType=false) at
/media/dgross/ssd01/git/llvm/tools/clang/lib/AST/ItaniumMangle.cpp:2087
#23 0x0000000002db13be in (anonymous
namespace)::CXXNameMangler::mangleFunctionEncoding (this=0x7fffffffa0f0,
FD=0x7dc42d0) at
/media/dgross/ssd01/git/llvm/tools/clang/lib/AST/ItaniumMangle.cpp:528
#24 0x0000000002db2d73 in (anonymous
namespace)::CXXNameMangler::mangleLocalName (this=0x7fffffffa0f0, D=0x7d79788)
at /media/dgross/ssd01/git/llvm/tools/clang/lib/AST/ItaniumMangle.cpp:1159

Frames 16..24 then repeat thousands of times.</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>