<html>
    <head>
      <base href="http://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 --- - Assertion failed: (CurFn->isDeclaration() && "Function already has body?"), function StartFunction, file CodeGenFunction.cpp, line 500."
   href="http://llvm.org/bugs/show_bug.cgi?id=18031">18031</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion failed: (CurFn->isDeclaration() && "Function already has body?"), function StartFunction, file CodeGenFunction.cpp, line 500.
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>All
          </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>LLVM Codegen
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>ddkilzer@kilzer.net
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Reduced test case:

typedef struct mystruct { } *mystruct_t;
class MyClass {
 static const MyClass* create(mystruct_t q);
};
const MyClass* MyClass::create(mystruct_t q) { return 0; }
extern "C" {
 const MyClass* _ZN7MyClass6createEP8mystruct(mystruct_t q) { return 0; }
}

Original arguments used to reproduce (on Mac OS X 10.9) with trunk clang
r194422:

./clang-r194422/bin/clang -cc1 -triple x86_64-apple-macosx10.9.0 -emit-obj
-disable-free -main-file-name x.cpp -mrelocation-model pic -pic-level 2
-mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2
-target-linker-version 142 -gdwarf-2 -stdlib=libc++ -Os -Wno-trigraphs
-Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type
-Wno-implicit-atomic-properties -Wno-receiver-is-weak
-Wno-arc-repeated-use-of-weak -Wno-non-virtual-dtor -Wno-overloaded-virtual
-Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch
-Wno-unused-function -Wno-unused-label -Wno-unused-parameter
-Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized
-Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion
-Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion
-Wno-enum-conversion -Wno-shorten-64-to-32 -Wno-newline-eof -Wno-selector
-Wno-strict-selector-match -Wno-undeclared-selector
-Wno-deprecated-implementations -Wno-c++11-extensions -Wprotocol
-Wdeprecated-declarations -Winvalid-offsetof -Wno-sign-conversion -Wmost
-Wpointer-arith -Wcast-align -Wno-error=deprecated-declarations
-fdeprecated-macro -ferror-limit 19 -fmacro-backtrace-limit 0 -fmessage-length
0 -fvisibility-inlines-hidden -stack-protector 1 -mstackrealign -fblocks
-fno-rtti -fno-threadsafe-statics -fobjc-runtime=macosx-10.9.0
-fencode-extended-block-signature -fobjc-gc -fobjc-exceptions -fexceptions
-fpascal-strings -fno-common -fdiagnostics-show-option
-fdiagnostics-show-note-include-stack -fasm-blocks -vectorize-loops
-vectorize-slp -x c++ x.cpp</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>