[PATCH] D29812: Update template-id-expr.cpp test to work when compiler defaults to non-C++03 standard

Douglas Yung via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 9 21:26:56 PST 2017


dyung created this revision.

Recently a change was made to this test in r294639 which fails because the compiler only generates one of the warnings when the compiler is in C++03 or lower mode.

This change fixes that as well as adds explicit run lines to run the test in C++03 and C++11 modes.


https://reviews.llvm.org/D29812

Files:
  test/SemaTemplate/template-id-expr.cpp


Index: test/SemaTemplate/template-id-expr.cpp
===================================================================
--- test/SemaTemplate/template-id-expr.cpp
+++ test/SemaTemplate/template-id-expr.cpp
@@ -1,4 +1,6 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++03 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
 // PR5336
 template<typename FromCl>
 struct isa_impl_cl {
@@ -104,5 +106,8 @@
   template<> class D<C>;  // expected-error {{cannot specialize a template template parameter}}
   friend class D<C>; // expected-error {{type alias template 'D' cannot be referenced with a class specifier}}
 };
-template<typename T> using D = int; // expected-note {{declared here}} expected-warning {{extension}}
+#if __cplusplus <= 199711L
+// expected-warning at +2 {{extension}}
+#endif
+template<typename T> using D = int; // expected-note {{declared here}} 
 E<D> ed; // expected-note {{instantiation of}}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29812.87963.patch
Type: text/x-patch
Size: 964 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170210/730f2fff/attachment.bin>


More information about the cfe-commits mailing list