<div>Hi,</div><div><br></div><div>What do you think about this code and clang reaction?</div><div><br></div><div>struct A<br>{<br>   static const char * a;<br>};<br><br>const char * A::a = "O.o";<br><br>struct B<br>
{<br>   B(const char * s);<br>};<br><br>struct C<br>{<br>   C(B& b);<br>};<br><br>class Problem<br>{<br>public:<br>   void foo()<br>   {<br>        C c(B(A::a)); // error here<br>   }<br>};</div><div><br></div><div><br>
</div><div>> clang++ x.cpp<br>x.cpp:23:6: warning: parentheses were disambiguated as a function declarator<br>      [-Wvexing-parse]<br>                C c(B(A::a)); // error here<br>                   ^~~~~~~~~<br>x.cpp:23:12: error: parameter declarator cannot be qualified<br>
                C c(B(A::a)); // error here<br>                      ~~~^<br>1 warning and 1 error generated.<br></div><div><br></div><div>> clang -v<br>FreeBSD clang version 3.1 (branches/release_31 156863) 20120523<br>
Target: x86_64-unknown-freebsd9.0<br>Thread model: posix</div>