<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 --- - clang objective-c++ incorrect mangling for function with multiple id parameters"
   href="http://llvm.org/bugs/show_bug.cgi?id=21688">21688</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang objective-c++ incorrect mangling for function with multiple id parameters
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.5
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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>joao@abecasis.name
          </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>Consider:

  // mangling.cpp

  struct objc_selector;
  struct objc_object;

  typedef struct objc_selector *SEL;
  typedef struct objc_object *id;

  struct NSObject;

  void good1(id, id) { }
  void good2(struct NSObject *, id, id) { }
  void good3(struct NSObject *, SEL, id) { }

  void bad1(struct NSObject *, SEL, id,  id) { }
  void bad2(struct NSObject *, SEL, id,  id, id) { }

Compiling this code as Objective C++ generates what seems to be incorrect name
mangling for the "bad" functions:

  $ clang++ -x objective-c++ -c mangling.cc && nm mangling.o | c++filt
  0000000000000138 short EH_frame0
  0000000000000050 T bad1(NSObject*, objc_selector*, objc_object*, objc_object)
  00000000000001c8 S bad1(NSObject*, objc_selector*, objc_object*, objc_object)
(.eh)
  0000000000000070 T bad2(NSObject*, objc_selector*, objc_object*, objc_object,
objc_object)
  00000000000001f0 S bad2(NSObject*, objc_selector*, objc_object*, objc_object,
objc_object) (.eh)
  0000000000000000 T good1(objc_object*, objc_object*)
  0000000000000150 S good1(objc_object*, objc_object*) (.eh)
  0000000000000010 T good2(NSObject*, objc_object*, objc_object*)
  0000000000000178 S good2(NSObject*, objc_object*, objc_object*) (.eh)
  0000000000000030 T good3(NSObject*, objc_selector*, objc_object*)
  00000000000001a0 S good3(NSObject*, objc_selector*, objc_object*) (.eh)

Compiling as C++ generates what seems to be the correct mangling:

  $ clang++ -x c++ -c mangling.cc && nm mangling.o | c++filt
  0000000000000130 short EH_frame0
  0000000000000050 T bad1(NSObject*, objc_selector*, objc_object*,
objc_object*)
  00000000000001c0 S bad1(NSObject*, objc_selector*, objc_object*,
objc_object*) (.eh)
  0000000000000070 T bad2(NSObject*, objc_selector*, objc_object*,
objc_object*, objc_object*)
  00000000000001e8 S bad2(NSObject*, objc_selector*, objc_object*,
objc_object*, objc_object*) (.eh)
  0000000000000000 T good1(objc_object*, objc_object*)
  0000000000000148 S good1(objc_object*, objc_object*) (.eh)
  0000000000000010 T good2(NSObject*, objc_object*, objc_object*)
  0000000000000170 S good2(NSObject*, objc_object*, objc_object*) (.eh)
  0000000000000030 T good3(NSObject*, objc_selector*, objc_object*)
  0000000000000198 S good3(NSObject*, objc_selector*, objc_object*) (.eh)

My main issue here is that the mangling is inconsistent if code is compiled as
Objective-C++ or C++, which prevents using a function compiled as Objective C++
to be used in plain C++.</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>