[PATCH] D28889: Change where we handle arg-dependent diagnose_if attributes

George Burgess IV via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 27 17:14:02 PST 2017


george.burgess.iv added inline comments.


================
Comment at: test/SemaCXX/diagnose_if.cpp:615
+    // evaluator isn't able to evaluate `adl::Foo(1)` to a constexpr, though.
+    // I'm assuming this is because we assign it to a temporary.
+    for (void *p : adl::Foo(1)) {}
----------------
rsmith wrote:
> The range-based for is desugared to
> 
> ```
> auto &&__range = adl::Foo(1);
> auto __begin = begin(__range);
> auto __end = end(__range);
> // ...
> ```
> 
> so the argument in the call to `begin` is not considered constant.
Good to know. Thanks!


https://reviews.llvm.org/D28889





More information about the cfe-commits mailing list