<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 --- - c++11 name inclusion without std=c++11"
   href="https://llvm.org/bugs/show_bug.cgi?id=26754">26754</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>c++11 name inclusion without std=c++11
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libc++
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>FreeBSD
          </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>All Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>fernando.apesteguia@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>It seems that 'array' name is included into std namespace even if no -std=c++11
is specified.

Here is a test program:

#include <iostream>
using namespace std;
template<typename T>
struct array {
       array(T t);
};
using ::array;
template<typename T>
::array<T>::array(T t) {}

array<int> x(1);

Compile with  clang++ -c foo.cpp unless otherwise specified. Some results:

FreeBSD 10.2

_LIBCPP_VERSION 1101
clang++ --version
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
Target: x86_64-unknown-freebsd10.2
Thread model: posix

Compilation OK.

-----------------------

FreeBSD 11.0-CURRENT

foo.cpp:12:1: error: unknown type name 'array'
array<int> x(1);
        ^

2 errors generated

clang 3.7.1 (tags/RELEASE_371/final 255217)

Compilation FAILS
-----------------------------

Ubuntu 14.04
clang++ --version
Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4)
Target: x86_64-pc-linux-gnu
Thread model: posix

Compilation OK

If compiled with libc++
clang++ -c -stdlib=libc++ foo.cpp

Compilation OK.
-----------------------------

The problem was detected with cad/OpenVsp from our ports tree:

<a href="http://www.freshports.org/cad/openvsp/">http://www.freshports.org/cad/openvsp/</a>

That program compiled fine in FreeBSD 9.x and 10.x but fails with the new
clang/libc++ in 11-current.

You can see the discussion here:
<a href="https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207253">https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207253</a>

I don't know if maybe I'm missing something obvious here...

Please, let me know should you need me to run some tests.</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>