<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 22, 2016 at 5:27 PM, Hans Wennborg <span dir="ltr"><<a href="mailto:hans@chromium.org" target="_blank" class="cremed">hans@chromium.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">On Mon, Feb 22, 2016 at 1:13 PM, Samuel Benzaquen via cfe-commits<br>
<span class=""><<a href="mailto:cfe-commits@lists.llvm.org" class="cremed">cfe-commits@lists.llvm.org</a>> wrote:<br>
> Author: sbenza<br>
> Date: Mon Feb 22 15:13:02 2016<br>
> New Revision: 261574<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=261574&view=rev" rel="noreferrer" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-project?rev=261574&view=rev</a><br>
> Log:<br>
> [ASTMatchers] Add matcher hasAnyName.<br>
><br>
> Summary: Add matcher hasAnyName as an optimization over anyOf(hasName(),...)<br>
><br>
</span><span class="">> Reviewers: alexfh<br>
><br>
> Subscribers: klimek, cfe-commits<br>
><br>
> Differential Revision: <a href="http://reviews.llvm.org/D17163" rel="noreferrer" target="_blank" class="cremed">http://reviews.llvm.org/D17163</a><br>
<br>
</span>I've tried to fix the Visual Studio build in r261583. Please take a<br>
look to make sure the fixes seem reasonable.<br></blockquote><div><br></div><div>Sorry about that. I always forget that we can't use brace init lists in LLVM yet.</div><div>Yes. That fix is correct. It would be better to move the vector to avoid an extra copy.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span class=""><br>
<br>
> +++ cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h Mon Feb 22 15:13:02 2016<br>
> @@ -1844,11 +1844,24 @@ inline internal::Matcher<Stmt> sizeOfExp<br>
>  /// \code<br>
>  ///   namespace a { namespace b { class X; } }<br>
>  /// \endcode<br>
> -inline internal::Matcher<NamedDecl> hasName(std::string Name) {<br>
> -  return internal::Matcher<NamedDecl>(<br>
> -      new internal::HasNameMatcher(std::move(Name)));<br>
> +inline internal::Matcher<NamedDecl> hasName(const std::string &Name) {<br>
> +  return internal::Matcher<NamedDecl>(new internal::HasNameMatcher({Name}));<br>
<br>
</span>That doesn't compile with Visual Studio 2013:<br>
<br>
C:\b\build\slave\ClangToTWin\build\src\third_party\llvm\tools\clang\include\clang/ASTMatchers/ASTMatchers.h(1848)<br>
: error C2440: 'initializing' : cannot convert from 'initializer-list'<br>
to 'clang::ast_matchers::internal::HasNameMatcher'<br>
        Constructor for class<br>
'clang::ast_matchers::internal::HasNameMatcher' is declared 'explicit'<br>
<span class=""><br>
> +private:<br>
> +  struct Pattern {<br>
> +    StringRef Pattern;<br>
<br>
</span>C:\b\build\slave\ClangToTWin\build\src\third_party\llvm\tools\clang\lib\ASTMatchers\ASTMatchersInternal.cpp(394)<br>
: error C2380: type(s) preceding 'Pattern' (constructor with return<br>
type, or illegal redefinition of current class-name?)<br></blockquote><div><br></div><div> <br></div></div><br></div></div>