--- /dev/null
+// PR c++/87530
+// { dg-do compile { target c++11 } }
+
+struct Base { };
+
+template<typename T>
+struct A : Base
+{
+ A();
+ A(Base&&);
+};
+
+A<int> foo()
+{
+ A<double> v;
+ return v; // { dg-error "cannot bind rvalue reference" "" { target c++17_down } }
+}
--- /dev/null
+// PR c++/58156
+// { dg-do compile { target c++11 } }
+
+template <class T, class... U>
+void Foo(U&...) {}
+
+template <class T, class... U>
+void Foo(const U&...) {}
+
+void Bar() {
+ const int a = 0;
+ Foo<int>(a);
+}
--- /dev/null
+// PR c++/68828
+// { dg-do compile { target c++20 } }
+
+template <typename... Types>
+struct Var
+{
+};
+
+struct A
+{
+};
+
+template <typename T>
+T
+forward(T t)
+{
+ return static_cast<T>(t);
+}
+
+template <typename V, typename... Types, typename... Args>
+bool requires_types_args(V&& v, Var<Types...>&, Args&&... args)
+{
+ return (true && ... &&
+ requires (V&& v, Types type, Args... args) {
+ foo(forward<V>(v), forward<Types>(type),
+ forward<Args>(args)...);
+ }
+ );
+}
+
+void bar()
+{
+ Var<int, char> v;
+ requires_types_args(A(), v, 1, 'b');
+}
--- /dev/null
+// PR c++/86002
+// { dg-do compile { target c++20 } }
+
+struct X {};
+struct Y { int i; };
+
+template <typename T>
+int f(T t)
+{
+ if constexpr (requires { t.i; })
+ return t.i;
+ else
+ return {};
+}
+
+int main()
+{
+ return f(X{}) + f(Y{});
+}
--- /dev/null
+// PR c++/91525
+// { dg-do compile { target c++20 } }
+
+struct X {
+ void operator<<(long);
+ void operator<<(bool);
+} x;
+struct B {
+ template <bool = true> operator bool();
+ template <bool = true> requires false operator bool();
+} b;
+
+void
+fn()
+{
+ x << b;
+}
--- /dev/null
+// PR c++/96223
+// { dg-do compile { target c++20 } }
+// DR 1787 (if an indeterminate value is produced by an evaluation, the
+// behavior is undefined except in certain cases)
+// Note that P1331R2 explicitly disallows in a constant evaluation:
+// - an lvalue-to-rvalue conversion that is applied to an object with
+// indeterminate value ([basic.indet]).
+
+#include <cstddef>
+
+constexpr int
+fn1 ()
+{
+ unsigned char foo;
+ unsigned char u = foo; // { dg-error "not usable in a constant expression" }
+ return 0;
+}
+
+constexpr int
+fn2 ()
+{
+ unsigned char foo;
+ int i = foo; // { dg-error "not usable in a constant expression" }
+ return 0;
+}
+
+constexpr int
+fn3 ()
+{
+ unsigned char foo;
+ char8_t u = foo; // { dg-error "not usable in a constant expression" }
+ return 0;
+}
+
+constexpr int
+fn4 ()
+{
+ std::byte foo;
+ std::byte b = foo; // { dg-error "not usable in a constant expression" }
+ return 0;
+}
+
+constexpr int w1 = fn1 ();
+constexpr int w2 = fn2 ();
+constexpr int w3 = fn3 ();
+constexpr int w4 = fn4 ();
--- /dev/null
+// PR c++/87032
+// { dg-do compile { target c++20 } }
+
+struct f1 {int x,y;};
+struct f2 {int x,y,z,t;};
+
+struct T {
+const char * name;
+union {
+ struct f1 fn1;
+ struct f2 fn2;
+} d;
+};
+
+extern "C" void p(struct T);
+
+int main(){
+p({"%x",{.fn2={1,2,3,4}}});
+}
--- /dev/null
+// PR c++/35098
+// { dg-do compile }
+
+template<typename T> struct A
+{
+ T a, __attribute((unused)) b; // { dg-warning "attribute ignored" }
+};