diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-52830.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-52830.C new file mode 100644 index 0000000000000000000000000000000000000000..2c9d2f9b329eafb5c2f8f0ca51a2f3d903c6a05c --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-52830.C @@ -0,0 +1,37 @@ +// PR c++/52830 +// { dg-do compile { target c++11 } } +// { dg-ice "comptypes" } + +template<bool b> struct eif { typedef void type; }; +template<> struct eif<false> {}; + +template<class A, class B> struct same +{ + static constexpr bool value = false; +}; +template<class A> +struct same<A, A> +{ + static constexpr bool value = true; +}; + + +struct foo { + template<class T> + void func(T && a, + typename eif<same<decltype(a), int&&>::value>::type * = 0); +}; + +template<class T> +void +foo:: +func(T && a, + typename eif<same<decltype(a), int&&>::value>::type * ) +{ +} + +void do_stuff() +{ + foo f; + f.func(12); +} diff --git a/gcc/testsuite/g++.dg/cpp0x/vt-88982.C b/gcc/testsuite/g++.dg/cpp0x/vt-88982.C new file mode 100644 index 0000000000000000000000000000000000000000..cb9530dcee12251ca842787fdfa1b82fea010bb4 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/vt-88982.C @@ -0,0 +1,14 @@ +// PR c++/88982 +// { dg-do compile { target c++11 } } +// { dg-ice "tsubst_pack_expansion" } + +template<typename...Ts> struct A { + template<template<typename, Ts = 0> class ...Cs, Cs<Ts> ...Vs> struct B { + B() { + } + }; +}; + +template<typename, int> using Int = int; +template<typename, short> using Char = char; +A<int, short>::B<Int, Char> b; diff --git a/gcc/testsuite/g++.dg/cpp1z/class-deduction76.C b/gcc/testsuite/g++.dg/cpp1z/class-deduction76.C new file mode 100644 index 0000000000000000000000000000000000000000..23bb6e8fa9af59a2bef04ff1267bb3f2ca9c41ae --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/class-deduction76.C @@ -0,0 +1,25 @@ +// PR c++/90799 +// { dg-do compile { target c++17 } } +// { dg-ice "unify" } + +template<class T> +void foo() noexcept(T::value); + +struct S { + static constexpr const bool value = true; + + template<class T> + void bar() noexcept(T::value); +}; + +template<class... Args, bool is_noexcept> +constexpr bool is_noexcept_function(void(Args...) noexcept(is_noexcept)) noexcept { + return is_noexcept; +} + +template<class... Args, bool is_noexcept> +constexpr bool is_noexcept_member_function(void(S::*)(Args...) noexcept(is_noexcept)) noexcept { + return is_noexcept; +} + +static_assert(is_noexcept_function(foo<S>)); diff --git a/gcc/testsuite/g++.dg/cpp1z/constexpr-lambda26.C b/gcc/testsuite/g++.dg/cpp1z/constexpr-lambda26.C new file mode 100644 index 0000000000000000000000000000000000000000..d6c8bae525fa5c843999633a8bdb55215f779cf1 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/constexpr-lambda26.C @@ -0,0 +1,13 @@ +// PR c++/87765 +// { dg-do compile { target c++17 } } +// { dg-ice "cxx_eval_constant_expression" } + +template <int N> +using foo = int; + +struct A { + constexpr int bar() const { return 42; } +}; + +void baz(A a) { + [=](auto c) { return foo<a.bar()> { }; }; } diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class39.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class39.C new file mode 100644 index 0000000000000000000000000000000000000000..f5f79a71ec2c31f1380487dafb5d46ee59034b2e --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class39.C @@ -0,0 +1,12 @@ +// PR c++/89565 +// { dg-do compile { target c++20 } } +// { dg-ice "resolve_args" } + +template <auto> +struct N{}; + +template <N> +struct S {}; + +template <typename T> +using NS = S<T::value>;