Clang Project

clang_source_code/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p4.cpp
1// RUN: %clang_cc1 -std=c++1z -verify %s
2
3void f() noexcept;
4void (&r)() = f;
5void (&s)() noexcept = r; // expected-error {{cannot bind}}
6
7void (&cond1)() noexcept = true ? r : f; // expected-error {{cannot bind}}
8void (&cond2)() noexcept = true ? f : r; // expected-error {{cannot bind}}
9// FIXME: Strictly, the rules in p4 don't allow this, because the operand types
10// are not of the same type other than cv-qualifiers, but we consider that to
11// be a defect, and instead allow reference-compatible types here.
12void (&cond3)() = true ? r : f;
13void (&cond4)() = true ? f : r;
14