================
@@ -47,6 +47,28 @@ void f() {
 #endif
 } // namespace cwg2813
 
+namespace cwg2815 { // cwg2815: 21
+#if __cplusplus >= 201703L
+int arg() noexcept;
+
+int f(int (&)() noexcept);
+void f(int (&)());
+int i = f(arg);
+
+int g(int (*)() noexcept);
+void g(int (&)());
+int j = g(arg);
+
+int h(int (&)() noexcept);
+void h(int (*)());
+int k = h(arg);
+
+int a(int (*)()); // expected-note {{candidate function}}
+int a(int (&)()); // expected-note {{candidate function}}
+int x = a(arg); // expected-error {{call to 'a' is ambiguous}}
+#endif
----------------
offsetof wrote:

`f`, `g` and `h` would fail in standard versions without `noexcept` in the type 
system (pre-C++17). 

https://github.com/llvm/llvm-project/pull/132778
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to