[clang-tools-extra] r247393 - clang-tidy/readability-inconsistent-declaration-parameter-name.cpp: Appease MS-incompatibility [-fno-delayed-template-parsing]

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 15 08:31:05 PDT 2015


On Fri, Sep 11, 2015 at 3:30 PM, Aaron Ballman <aaron at aaronballman.com>
wrote:

> On Fri, Sep 11, 2015 at 9:27 AM, Alexander Kornienko via cfe-commits
> <cfe-commits at lists.llvm.org> wrote:
> > Thank you for the fix and sorry for breaking this again. I wonder what's
> the
> > reason windows-targeting enables -fdelayed-template-parsing?
>
> Because that's required for MSVC compatibility.
>

That's what I understood from reading the flag description
<http://clang.llvm.org/docs/UsersManual.html#c_ms>, however it doesn't help
me understand why. But reading this
<http://stackoverflow.com/questions/13140632/how-can-i-port-msvc-code-with-non-dependent-names-in-templates-to-linux>
and this
<http://eli.thegreenplace.net/2012/02/06/dependent-name-lookup-for-c-templates/>
made things clear. So it looks like we can't safely turn this off, because
some code may rely on this, but with this option the AST doesn't contain
bodies of FunctionTemplateDecls, which affects some checks.

And this seems to be the issue for other Clang Tools as well. There was a
discussion about that
<http://lists.llvm.org/pipermail/cfe-dev/2014-August/038415.html> last
year, which has lead nowhere, I guess.


>
> > Would it be the right thing to always turn this off in clang-tidy?
>
>  I don't think it would be a good thing to turn off in clang-tidy as
> the behavior would diverge from the default in clang on Windows (with
> MSVC mode).
>
> ~Aaron
>
> >
> >
> > On Fri, Sep 11, 2015 at 10:16 AM, NAKAMURA Takumi via cfe-commits
> > <cfe-commits at lists.llvm.org> wrote:
> >>
> >> Author: chapuni
> >> Date: Fri Sep 11 03:16:22 2015
> >> New Revision: 247393
> >>
> >> URL: http://llvm.org/viewvc/llvm-project?rev=247393&view=rev
> >> Log:
> >> clang-tidy/readability-inconsistent-declaration-parameter-name.cpp:
> >> Appease MS-incompatibility [-fno-delayed-template-parsing]
> >>
> >> Modified:
> >>
> >>
> clang-tools-extra/trunk/test/clang-tidy/readability-inconsistent-declaration-parameter-name.cpp
> >>
> >> Modified:
> >>
> clang-tools-extra/trunk/test/clang-tidy/readability-inconsistent-declaration-parameter-name.cpp
> >> URL:
> >>
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/readability-inconsistent-declaration-parameter-name.cpp?rev=247393&r1=247392&r2=247393&view=diff
> >>
> >>
> ==============================================================================
> >> ---
> >>
> clang-tools-extra/trunk/test/clang-tidy/readability-inconsistent-declaration-parameter-name.cpp
> >> (original)
> >> +++
> >>
> clang-tools-extra/trunk/test/clang-tidy/readability-inconsistent-declaration-parameter-name.cpp
> >> Fri Sep 11 03:16:22 2015
> >> @@ -1,4 +1,4 @@
> >> -// RUN: %python %S/check_clang_tidy.py %s
> >> readability-inconsistent-declaration-parameter-name %t
> >> +// RUN: %python %S/check_clang_tidy.py %s
> >> readability-inconsistent-declaration-parameter-name %t -- -std=c++11
> >> -fno-delayed-template-parsing
> >>
> >>  void consistentFunction(int a, int b, int c);
> >>  void consistentFunction(int a, int b, int c);
> >>
> >>
> >> _______________________________________________
> >> cfe-commits mailing list
> >> cfe-commits at lists.llvm.org
> >> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
> >
> >
> >
> > _______________________________________________
> > 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/20150915/99c7ecc9/attachment.html>


More information about the cfe-commits mailing list