<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++ fails to compile libstdc++ debug/vector with -D_GLIBCXX_DEBUG -std=c++11" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D23602&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=THS3YtJES6XSrAezHgwmbNOFx61YZPbZRDHOIV1rbTo&s=45DuV7uOiZ0GHGCMvwphHyN5ZNMSXKQISnNaGJ2SBgE&e=">23602</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang++ fails to compile libstdc++ debug/vector with -D_GLIBCXX_DEBUG -std=c++11
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </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++11
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>adam@spicenitz.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>clang version 3.7.0 (trunk 233105)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/5.1.1
Selected GCC installation: /usr/lib/gcc/x86_64-redhat-linux/5.1.1
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64

Version of libstdc++:
libstdc++-devel-5.1.1-1.fc22.x86_64


Sample code:

#include <vector>

int main() {
  const std::vector<int> empty_ints;

  return empty_ints.size();
}



$ clang++ -D_GLIBCXX_DEBUG -std=c++11 c.cpp 
c.cpp:4:26: error: default initialization of an object of const type 'const
std::vector<int>' without a user-provided default constructor
  const std::vector<int> empty_ints;
                         ^
c.cpp:4:36: note: add an explicit initializer to initialize 'empty_ints'
  const std::vector<int> empty_ints;
                                   ^
                                   {}
1 error generated.



This error does not occur if I leave out either -D_GLIBCXX_DEBUG or -std=c++11.
This also works correctly with g++ 5.1.1.</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>