From: Richard Smith Date: Sat, 22 Oct 2016 01:32:45 +0000 (+0000) Subject: Add another testcase missed from r284905. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d065ea4c470a52237ec76d30828bab9599080b0c;p=clang Add another testcase missed from r284905. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284906 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p4.cpp b/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p4.cpp new file mode 100644 index 0000000000..1a3732d99e --- /dev/null +++ b/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p4.cpp @@ -0,0 +1,13 @@ +// RUN: %clang_cc1 -std=c++1z -verify %s + +void f() noexcept; +void (&r)() = f; +void (&s)() noexcept = r; // expected-error {{cannot bind}} + +void (&cond1)() noexcept = true ? r : f; // expected-error {{cannot bind}} +void (&cond2)() noexcept = true ? f : r; // expected-error {{cannot bind}} +// FIXME: Strictly, the rules in p4 don't allow this, because the operand types +// are not of the same type other than cv-qualifiers, but we consider that to +// be a defect, and instead allow reference-compatible types here. +void (&cond3)() = true ? r : f; +void (&cond4)() = true ? f : r;