<div dir="ltr"><div class="gmail_quote">hi, CFE list,</div><div class="gmail_quote"><br><div dir="ltr"><div>I wonder if C++ allows to declare exception spec in typdef.</div><div><br></div><div>eg. </div><div>typedef int name() throw(int) ;<br></div><div><br></div><div>I tested t.cpp using g++/clang, they all forbid this behavior. </div><div><br></div><div>clang gives me quite clear answer. </div><div><div>t.cpp:4:20: error: exception specifications are not allowed in typedefs</div><div>typedef int name() throw(int) ;</div><div>                   ^</div><div>t.cpp:5:24: error: exception specifications are not allowed in typedefs</div><div>typedef int (*pname)() throw(int) ;</div><div>                       ^</div><div>t.cpp:6:24: error: exception specifications are not allowed in typedefs</div><div>typedef int (&rname)() throw(int) ;</div><div>                       ^</div><div>3 errors generated.</div></div><div><br></div><div>t.cpp is actually from microsoft's AMP testsuite. I believe VC++ accepts it (sorry, I didn't verify using vc++, because I can't access windows by now). </div><div><br></div><div>According to my google result, N4533 and P0012R1 try to remove this restriction, am I right?</div><div><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0012r1.html" target="_blank">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0012r1.html</a></div><div><br></div><div><br></div><div>thanks,</div><div>--lx</div><div><br></div><div><br></div></div>
</div><br></div>