[llvm-bugs] [Bug 26754] New: c++11 name inclusion without std=c++11

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Feb 26 15:05:54 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=26754

            Bug ID: 26754
           Summary: c++11 name inclusion without std=c++11
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: fernando.apesteguia at gmail.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com
    Classification: Unclassified

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:

http://www.freshports.org/cad/openvsp/

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:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207253

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

Please, let me know should you need me to run some tests.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160226/e12c9903/attachment.html>


More information about the llvm-bugs mailing list