diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-08-30 19:17:11 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-08-30 19:17:11 +0000 |
| commit | 59ef62005921e66c43f52332cf6e2a0bad745cf1 (patch) | |
| tree | cf5b7b10a485cce98cd63e56ebe9b7a70e009301 | |
| parent | 218538ebe95294ec8550853df15277d6b61c7c3d (diff) | |
| download | bcm5719-llvm-59ef62005921e66c43f52332cf6e2a0bad745cf1.tar.gz bcm5719-llvm-59ef62005921e66c43f52332cf6e2a0bad745cf1.zip | |
Add test file missed from r341097.
llvm-svn: 341099
| -rw-r--r-- | clang/test/SemaCXX/cxx14-compat.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/cxx14-compat.cpp b/clang/test/SemaCXX/cxx14-compat.cpp new file mode 100644 index 00000000000..8b3dee8c822 --- /dev/null +++ b/clang/test/SemaCXX/cxx14-compat.cpp @@ -0,0 +1,34 @@ +// RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wc++14-compat-pedantic -verify %s +// RUN: %clang_cc1 -fsyntax-only -std=c++17 -Wc++14-compat-pedantic -verify %s + +#if __cplusplus < 201402L + +// expected-no-diagnostics +// FIXME: C++11 features removed or changed in C++14? + +#else + +static_assert(true); // expected-warning {{incompatible with C++ standards before C++17}} + +template<int ...N> int f() { return (N + ...); } // expected-warning {{incompatible with C++ standards before C++17}} + +namespace [[]] NS_with_attr {} // expected-warning {{incompatible with C++ standards before C++17}} +enum { e [[]] }; // expected-warning {{incompatible with C++ standards before C++17}} + +template<typename T = int> struct X {}; +X x; // expected-warning {{class template argument deduction is incompatible with C++ standards before C++17}} + +template<template<typename> class> struct Y {}; +Y<X> yx; // ok, not class template argument deduction + +template<typename T> void f(T t) { + X x = t; // expected-warning {{incompatible}} +} + +template<typename T> void g(T t) { + typename T::X x = t; // expected-warning {{incompatible}} +} +struct A { template<typename T> struct X { X(T); }; }; +void h(A a) { g(a); } // expected-note {{in instantiation of}} + +#endif |

