summaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2019-09-28 11:36:36 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2019-09-28 11:36:36 +0000
commit028c9b3be468a5dbd27e3190b14d60b04ea02ff4 (patch)
treea772b67e0ee5e04c2906c6b99d6e46b40c878a1a /gcc/cp/pt.c
parentc57a385006790d814e1f9ac4f4235a787c6c6e30 (diff)
downloadgcc-028c9b3be468a5dbd27e3190b14d60b04ea02ff4.tar.gz
PR c++/91923 - failure-to-SFINAE with class type NTTP in C++17.
* pt.c (invalid_nontype_parm_type_p): Only emit errors when tf_error. * g++.dg/cpp0x/nontype5.C: New test. From-SVN: r276248
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 5a2dfbbd994..44b36183304 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -25232,8 +25232,9 @@ invalid_nontype_parm_type_p (tree type, tsubst_flags_t complain)
{
if (cxx_dialect < cxx2a)
{
- error ("non-type template parameters of class type only available "
- "with %<-std=c++2a%> or %<-std=gnu++2a%>");
+ if (complain & tf_error)
+ error ("non-type template parameters of class type only available "
+ "with %<-std=c++2a%> or %<-std=gnu++2a%>");
return true;
}
if (dependent_type_p (type))