summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/cxx1z-constexpr-if.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Try contextually converting condition of constexpr if to Boolean valueIsmail Pazarbasi2016-09-071-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: C++1z 6.4.1/p2: If the if statement is of the form if constexpr, the value of the condition shall be a contextually converted constant expression of type bool [...] C++1z 5.20/p4: [...] A contextually converted constant expression of type bool is an expression, contextually converted to bool (Clause4), where the converted expression is a constant expression and the conversion sequence contains only the conversions above. [...] Contextually converting result of an expression `e` to a Boolean value requires `bool t(e)` to be well-formed. An explicit conversion function is only considered as a user-defined conversion for direct-initialization, which is essentially what //contextually converted to bool// requires. Also, fixes PR28470. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D24158 llvm-svn: 280838
* Implement p0292r2 (constexpr if), a likely C++1z feature.Richard Smith2016-06-231-0/+21
llvm-svn: 273602
OpenPOWER on IntegriCloud