<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">Please enjoy this clang 7.0.0 fork:</div><div class=""><br class=""></div><a href="https://github.com/drec357/clang-meta" class="">https://github.com/drec357/clang-meta</a><div class=""><br class=""></div><div class="">This reflection implementation reflects just about the entire clang AST, and lets you use clang syntax/names in *regular, non-clang* C++ code:</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class="">namespace ns { class MyClass { float f; }; }</div><div class="">constexpr {</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>ce_assert(reflexpr(ns)->isInline());</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>ce_assert(!reflexpr(ns)->isAnonymousNamespace())</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>FOR ( (Decl *D) : reflexpr(ns::MyClass)->decls()) {</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>if (auto_ FD = dyn_cast<FieldDecl>(D))</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>FD->dump();</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>}</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>//As for meta-parsing:</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>__queue_metaparse("static const int i = ");</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>constexpr int ival = __metaparse_expr(__concatenate("3", 2+2), int);</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>__queue_metaparse(jval);</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>__queue_metaparse(";")</div><div class=""><br class=""></div><div class="">} // queued metatparses performed here…</div><div class=""><br class=""></div><div class="">static_assert(i = 34);</div></blockquote><div class=""><br class=""></div><div class="">Plus you can define clang-style diagnostics and FixItHints, using reflected SourceLocations, in your regular, non-clang code.</div><div class=""><br class=""></div><div class="">Please adapt to any uses you see fit! I would love to see this way in the C++ standards, much more general and low-maintenance than the proposals I’ve seen, but I sense that will be an uphill battle. Please let me know if you would support this way of doing reflection/metaprogramming, or have suggestions on how to proceed.</div><div class=""><br class=""></div><div class="">David Rector</div></body></html>