<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Feb 1, 2012 at 2:27 PM, Marshall Clow <span dir="ltr"><<a href="mailto:mclow@qualcomm.com" target="_blank">mclow@qualcomm.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Author: marshall<br>
Date: Wed Feb 1 16:27:24 2012<br>
New Revision: 149552<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=149552&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=149552&view=rev</a><br>
Log:<br>
added const nullptr tests<br>
<br>
Added:<br>
libcxxabi/trunk/test/catch_const_pointer_nullptr.cpp<br>
<br>
Added: libcxxabi/trunk/test/catch_const_pointer_nullptr.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/catch_const_pointer_nullptr.cpp?rev=149552&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/catch_const_pointer_nullptr.cpp?rev=149552&view=auto</a><br>
==============================================================================<br>
--- libcxxabi/trunk/test/catch_const_pointer_nullptr.cpp (added)<br>
+++ libcxxabi/trunk/test/catch_const_pointer_nullptr.cpp Wed Feb 1 16:27:24 2012<br>
@@ -0,0 +1,133 @@<br>
+//===--------------------- catch_const_pointer_nullptr.cpp ----------------------===//<br>
+//<br>
+// The LLVM Compiler Infrastructure<br>
+//<br>
+// This file is dual licensed under the MIT and the University of Illinois Open<br>
+// Source Licenses. See LICENSE.TXT for details.<br>
+//<br>
+//===----------------------------------------------------------------------===//<br>
+<br>
+#include <cassert><br>
+<br>
+#if __has_feature(cxx_nullptr)<br>
+<br>
+struct A {};<br>
+<br>
+void test1()<br>
+{<br>
+ try<br>
+ {<br>
+ throw nullptr;<br>
+ assert(false);<br>
+ }<br>
+ catch (A*)<br>
+ {<br>
+ }<br>
+ catch (const A*)<br>
+ {<br>
+ assert(false);<br>
+ }<br>
+}<br>
+<br>
+<br>
+void test2()<br>
+{<br>
+ try<br>
+ {<br>
+ throw nullptr;<br>
+ assert(false);<br>
+ }<br>
+ catch (const A*)<br>
+ {<br>
+ }<br>
+ catch (A*)<br>
+ {<br>
+ assert(false);<br>
+ }<br>
+}<br>
+<br>
+void test3()<br>
+{<br>
+ try<br>
+ {<br>
+ throw nullptr;<br>
+ assert(false);<br>
+ }<br>
+ catch (const A const*)<br></blockquote><div><br></div><div>Was this supposed to say `const A * const`? (Also in test4) As is, clang warns</div><div><br></div><div><div>catch_const_pointer_nullptr.cpp:56:20: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]</div>
<div> catch (const A const*)</div><div> ^~~~~</div><div>catch_const_pointer_nullptr.cpp:75:20: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]</div><div> catch (const A const*)</div>
</div><div><div> ^~~~~</div></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
+ {<br>
+ }<br>
+ catch (A*)<br>
+ {<br>
+ assert(false);<br>
+ }<br>
+}<br>
+<br>
+void test4()<br>
+{<br>
+ try<br>
+ {<br>
+ throw nullptr;<br>
+ assert(false);<br>
+ }<br>
+ catch (A*)<br>
+ {<br>
+ }<br>
+ catch (const A const*)<br>
+ {<br>
+ assert(false);<br>
+ }<br>
+}<br>
+<br>
+void test5()<br>
+{<br>
+ try<br>
+ {<br>
+ throw nullptr;<br>
+ assert(false);<br>
+ }<br>
+ catch (A const*)<br>
+ {<br>
+ }<br>
+ catch (A*)<br>
+ {<br>
+ assert(false);<br>
+ }<br>
+}<br>
+<br>
+void test6()<br>
+{<br>
+ try<br>
+ {<br>
+ throw nullptr;<br>
+ assert(false);<br>
+ }<br>
+ catch (A*)<br>
+ {<br>
+ }<br>
+ catch (A const*)<br>
+ {<br>
+ assert(false);<br>
+ }<br>
+}<br>
+<br>
+<br>
+#else<br>
+<br>
+void test1() {}<br>
+void test2() {}<br>
+void test3() {}<br>
+void test4() {}<br>
+void test5() {}<br>
+void test6() {}<br>
+<br>
+#endif<br>
+<br>
+int main()<br>
+{<br>
+ test1();<br>
+ test2();<br>
+ test3();<br>
+ test4();<br>
+ test5();<br>
+ test6();<br>
+}<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div></div>