r194445 - Extra test for r194444.
Richard Smith
richard-llvm at metafoo.co.uk
Mon Nov 11 18:42:08 PST 2013
Author: rsmith
Date: Mon Nov 11 20:42:08 2013
New Revision: 194445
URL: http://llvm.org/viewvc/llvm-project?rev=194445&view=rev
Log:
Extra test for r194444.
Added:
cfe/trunk/test/SemaTemplate/extension-sfinae.cpp
Added: cfe/trunk/test/SemaTemplate/extension-sfinae.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/extension-sfinae.cpp?rev=194445&view=auto
==============================================================================
--- cfe/trunk/test/SemaTemplate/extension-sfinae.cpp (added)
+++ cfe/trunk/test/SemaTemplate/extension-sfinae.cpp Mon Nov 11 20:42:08 2013
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -verify %s -pedantic-errors -DPEDANTIC
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -verify %s -Wno-c++11-narrowing
+
+namespace cce_narrowing {
+ decltype(short{123456}) a;
+#if PEDANTIC
+ // expected-error at -2 {{cannot be narrowed}} expected-note at -2 {{cast}}
+#endif
+
+ template<typename T> int f(decltype(T{123456})); // expected-note {{cannot be narrowed}}
+ int b = f<short>(0); // expected-error {{no match}}
+}
More information about the cfe-commits
mailing list