[cfe-dev] ConditionalOperator: rvalue or lvalue?
Eli Friedman
eli.friedman at gmail.com
Tue Aug 20 11:19:17 PDT 2013
On Tue, Aug 20, 2013 at 10:57 AM, Konstantin Tokarev <annulen at yandex.ru>wrote:
> Hi all,
>
> In the code fragment [1] ConditionalOperator is lvalue in clang AST, while
> in code fragments [2] and [3] it is reported as rvalue. The difference is
> that [2] declares DEFAULT_WEIGHT as enum constant, and [3] declares it as
> int constant.
>
> Is this behavior correct? Why in [1] ConditionalOperator is not rvalue too?
>
>
> This behavior is correct. It isn't an rvalue because the C++ standard
says it's an lvalue.
-Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130820/78a1059d/attachment.html>
More information about the cfe-dev
mailing list