<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 --- - Namespace lost in modules"
   href="https://llvm.org/bugs/show_bug.cgi?id=25368">25368</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Namespace lost in modules
          </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>Modules
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>geek4civic@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=15198" name="attach_15198" title="Small testcase.zip">attachment 15198</a> <a href="attachment.cgi?id=15198&action=edit" title="Small testcase.zip">[details]</a></span>
Small testcase.zip

I didn't compile lib/CodeGen/CGExprConstant.cpp with -fcxx-modules.

clang/lib/CodeGen/CGExprConstant.cpp:1041:16: error:
      no matching function for call to 'cast'
        return cast<ConstantAddress>(Res.getAddress());
               ^~~~~~~~~~~~~~~~~~~~~
llvm/include/llvm/Support/Casting.h:229:44: note:
      candidate function [with X = clang::CodeGen::ConstantAddress, Y =
      clang::CodeGen::Address] not viable: expects an l-value for 1st argument
inline typename cast_retty<X, Y>::ret_type cast(Y &Val) {
                                           ^

Seems namespace forwarders, Basic/LLVM.h, might not be effective there.
Appeased in r251713.

A small testcase is attached.
$ clang++ -std=c++11 -fmodules -fcxx-modules -c a.cc</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>