<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 CUDA - doesn't enforce target matching for method calls"
   href="http://llvm.org/bugs/show_bug.cgi?id=20886">20886</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang CUDA - doesn't enforce target matching for method calls
          </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>Frontend
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>eliben@gmail.com
          </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>$ cat method-target-mismatch.cu 
struct S {
  void method() {}
};

__attribute__((device)) void foo() {
  S s;
  s.method();
}

When compiled with nvcc:

$ /usr/local/cuda/bin/nvcc --verbose  -I/usr/local/cuda/include -m64
--gpu-architecture=compute_35 -c method-target-mismatch.cu
...

method-target-mismatch.cu(7): error: calling a __host__ function("S::method")
from a __device__ function("foo") is not allowed


When compiled with Clang (trunk):

$ $LLVMSVN/clang -cc1  -x cuda   method-target-mismatch.cu
$

No error generated.

Clang *does* generate an error when the mismatch is for a function (not
method), or a special method like default constructor.</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>