Your std::remove_if would be more concise if it used a lambda instead of IsNotEnableIfAttr.<br><div>On Sun Mar 09 2014 at 10:30:45 AM, Nick Lewycky <<a href="mailto:nicholas@mxc.ca">nicholas@mxc.ca</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The attached mangle-enable_if-1.patch adds a mangling for<br>
__attribute__((enable_if(expr, string-literal))) to clang.<br>
<br>
demangle-enable_if-1.patch adds support to libcxxabi's demangler. This<br>
patch I'm not very confident in. libcxxabi's cxa_demangle lacks comments<br>
and assertions, leaving its design criteria a mystery. I think the<br>
functions return 'first' in case of error. I added a vector<> inside the<br>
demangler, I don't know whether that's OK because it means doing<br>
allocation. I don't know what the two strings in the pair in db.names<br>
are for, but the first one appears to be the demangling so I put it<br>
there. I don't understand what the members in 'db' are for, since they<br>
aren't commented (db.tag_templates?). The code is cargo culted from<br>
parse_template_args and simplified down by making wild assumptions<br>
(db.tag_templates is always false!) and constant folding.<br>
<br>
Also the demangler seems pretty buggy. It wraps expressions in extra<br>
parentheses which don't correspond to pi .. E expressions (if you were<br>
to remangle it, you'd get the extra pi .. E). A mangling for "&function"<br>
ends up demangling "&(function())" which has different semantic meaning.<br>
  I'm assuming these problems are pre-existing. While "_Z3foo" demangles<br>
to "foo" and "_Z3foov" demangles to "foo()", the same things with an<br>
attribute demangle to include parens. For example, "_Z3fooUa3bar" and<br>
"_Z3fooUa3barv" both demangle to "foo() __attribute__((bar))", never<br>
"foo __attribute__((bar))".<br>
<br>
Finally, I've never even compiled the change to the tests. I have tested<br>
those exact manglings and seen what cxa_demangle does to them, but it<br>
was easier to write a standalone tool than to deal with "testit".<br>
<br>
Please review!<br>
<br>
Nick<br>
______________________________<u></u>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/cfe-commits</a><br>
</blockquote>