<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 --- - Clang 3.6 cannot compile program with -std=c++14"
href="https://llvm.org/bugs/show_bug.cgi?id=30277">30277</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Clang 3.6 cannot compile program with -std=c++14
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.6
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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>C++14
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>noloader@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>I'm working on Ubuntu 14.0.5 LTS. Ubuntu provides GCC 4.8 and Clang 3.6.
Clang 3.6 provided by Ubuntu claims to support C++14. -std=c++14 is not
rejected by the compiler during feature testing. The feature test program
includes the C++ header <iosfwd>.
Attempting to compile a test program:
$ cat test.cxx
#include <string>
int main(int argc, char* argv[])
{
return 0;
}
Results in the following:
$ clang++ -std=c++14 test.cxx -o test.exe
In file included from test.cxx:1:
In file included from
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/string:52:
In file included from
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/basic_string.h:2815:
In file included from
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/ext/string_conversions.h:43:
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/cstdio:120:11:
error:
no member named 'gets' in the global namespace
using ::gets;
~~^
1 error generated.
**********
Ubuntu Issue at "Clang 3.6 cannot compile program with -std=c++14",
<a href="http://bugs.launchpad.net/ubuntu/+bug/1620181">http://bugs.launchpad.net/ubuntu/+bug/1620181</a> .
According to <a href="http://stackoverflow.com/q/17775390/608639">http://stackoverflow.com/q/17775390/608639</a>, this issue is present
as early as Clang 3.3.
An interesting answer from a similar error report on Stack Overflow reveals
this (<a href="http://stackoverflow.com/a/17776548/608639">http://stackoverflow.com/a/17776548/608639</a>):
<BEGIN SNIP>
This note in the gets manpage looks relevant:
ISO C11 removes the specification of gets() from the C language, and since
version 2.16, glibc header files don't expose the function declaration if the
_ISOC11_SOURCE feature test macro is defined.
Probably should be:
#if !_ISOC11_SOURCE
using ::gets;
#endif
<END SNIP>
**********
$ clang++ -v
Ubuntu clang version 3.6.0-2ubuntu1~trusty1 (tags/RELEASE_360/final) (based on
LLVM 3.6.0)
Target: x86_64-pc-linux-gnu
Thread model: posix
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty</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>