From 58b4ab845af73acdbc25ec9d4227f7bcac0eea4f Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Sat, 22 Oct 2016 01:32:45 +0000 Subject: [PATCH] Add another testcase missed from r284905. llvm-svn: 284906 --- clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p4.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p4.cpp diff --git a/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p4.cpp b/clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p4.cpp new file mode 100644 index 0000000..1a3732d --- /dev/null +++ b/clang/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; -- 2.7.4