title: Error when using in-class initialization of non-static data member and nested class constructor
body: <p>The following code is quite trivial and I expected that it should compile fine.</p>
  
  <pre><code>struct A
  {
      struct B
      {
          int i = 0;
      };
  
      B b;
  
      A(const B&amp; _b = B())
          : b(_b)
      {}
  };
  </code></pre>
  
  <p>I've tested this code with g++ version 4.7.2, 4.8.1, clang++ 3.2 and 3.3. Apart from fact that g++ 4.7.2 segfaults on this code (<a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57770">http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57770</a>), the other tested compilers give error messages that don't explain much.</p>
  
  <p>g++ 4.8.1:</p>
  
  <pre><code>test.cpp: In constructor ‘constexpr A::B::B()’:
  test.cpp:3:12: error: constructor required before non-static data member for ‘A::B::i’ has been parsed
       struct B
              ^
  test.cpp: At global scope:
  test.cpp:11:23: note: synthesized method ‘constexpr A::B::B()’ first required here 
       A(const B&amp; _b = B())
                         ^
  </code></pre>
  
  <p>clang++ 3.2 and 3.3:</p>
  
  <pre><code>test.cpp:11:21: error: defaulted default constructor of 'B' cannot be used by non-static data member initializer which appears before end of class definition
      A(const B&amp; _b = B())
                      ^
  </code></pre>
  
  <p>Making this code compilable is possible and seems like it should make no difference. There are two options:</p>
  
  <pre><code>struct B
  {
      int i = 0;
      B(){} // using B()=default; works only for clang++
  };
  </code></pre>
  
  <p>or</p>
  
  <pre><code>struct B
  {
      int i;
      B() : i(0) {} // classic c++98 initialization
  };
  </code></pre>
  
  <p>Is this code really incorrect or are the compilers wrong?</p>