[PATCH] D15506: [ASTMatchers] Allow hasName() to look through inline namespaces

Yaron Keren via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 14 13:52:06 PST 2015


That's odd. I'm using the same update 5 exactly, added "  for (bool
SkipUnwritten : {false, true});" inside a LLVM source file and re-compiled.
MSVC complained about the unused SkipUnwritten but was therwise OK with the
code.


2015-12-14 23:43 GMT+02:00 Aaron Ballman <aaron.ballman at gmail.com>:

> On Mon, Dec 14, 2015 at 4:39 PM, Yaron Keren <yaron.keren at gmail.com>
> wrote:
> > MSVC 2013 Update 5 accepts for (bool SkipUnwritten : {false, true}).
> > Possibly changed in one of the Updates?
>
> I tested using MSVC 2013 Update 5.
>
> Microsoft Visual Studio Ultimate 2013
> Version 12.0.40629.00 Update 5
> Microsoft .NET Framework
> Version 4.6.01055
>
> ~Aaron
>
> >
> > 2015-12-14 23:35 GMT+02:00 Aaron Ballman via cfe-commits
> > <cfe-commits at lists.llvm.org>:
> >>
> >> aaron.ballman added a subscriber: aaron.ballman.
> >>
> >> ================
> >> Comment at: lib/ASTMatchers/ASTMatchersInternal.cpp:320
> >> @@ -323,3 +319,3 @@
> >>
> >> -  if (Pattern.startswith("::"))
> >> -    return FullName == Pattern;
> >> +  for (bool SkipUnwritten : {false, true}) {
> >> +    llvm::SmallString<128> NodeName = StringRef("::");
> >> ----------------
> >> Cute, but this won't work with MSVC 2013. You'll get: error C3312: no
> >> callable 'begin' function found for type 'initializer-list'
> >>
> >> ================
> >> Comment at: lib/ASTMatchers/ASTMatchersInternal.cpp:334
> >> @@ +333,3 @@
> >> +
> >> +    if (Pattern.startswith("::")) {
> >> +      if (FullName == Pattern) return true;
> >> ----------------
> >> Should elide braces and format using clang-format.
> >>
> >>
> >> http://reviews.llvm.org/D15506
> >>
> >>
> >>
> >> _______________________________________________
> >> cfe-commits mailing list
> >> cfe-commits at lists.llvm.org
> >> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151214/f2b54da5/attachment.html>


More information about the cfe-commits mailing list