From 67a5ad7cbdef324726772a35b03474f51c3e1a46 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Thu, 22 Dec 2016 15:29:02 -0500 Subject: [PATCH] Feature-test macro for P0522R0, matching of template template arguments. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_template_template_args. From-SVN: r243896 --- gcc/c-family/ChangeLog | 6 ++++++ gcc/c-family/c-cppbuiltin.c | 2 ++ gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index acdedc8..72a6803 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,9 @@ +2016-12-22 Jason Merrill + + Implement P0522R0, matching of template template arguments. + * c-cppbuiltin.c (c_cpp_builtins): Define + __cpp_template_template_args. + 2016-12-21 Jakub Jelinek PR bootstrap/78817 diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c index e2419e8..a841e53 100644 --- a/gcc/c-family/c-cppbuiltin.c +++ b/gcc/c-family/c-cppbuiltin.c @@ -985,6 +985,8 @@ c_cpp_builtins (cpp_reader *pfile) cpp_define_formatted (pfile, "__STDCPP_DEFAULT_NEW_ALIGNMENT__=%d", aligned_new_threshold); } + if (flag_new_ttp) + cpp_define (pfile, "__cpp_template_template_args=201611"); } /* Note that we define this for C as well, so that we know if __attribute__((cleanup)) will interface with EH. */ diff --git a/gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C b/gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C index 086fd25..f61b9f5 100644 --- a/gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C +++ b/gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C @@ -398,6 +398,12 @@ # error "__cpp_structured_bindings != 201606" #endif +#ifndef __cpp_template_template_args +# error "__cpp_template_template_args" +#elif __cpp_template_template_args != 201611 +# error "__cpp_template_template_args != 201611" +#endif + #ifdef __has_cpp_attribute # if ! __has_cpp_attribute(maybe_unused) -- 2.7.4