Value category of conditional operator
问题 Consider the following code: int x; int& f() { return x ? x : throw 0; } With gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04) I get the following compilation error: cannot bind non-const lvalue reference of type ‘int&’ to an rvalue of type ‘int’ Note that this compiles just fine in clang. Here is (what I believe to be) the relevant statement from the standard: N4659 [8.16.2.1] (Conditional Operator): The second or the third operand (but not both) is a (possibly parenthesized) throw