On Mon, Oct 26, 2015 at 9:21 PM, Daniel Jasper <djas...@google.com> wrote:
> I mixed up before and after. Other than that, I don't see a typo. > It looks like the test case "+ verifyFormat("std::function< void(int, int) > fct;", Spaces);" ensures no spaces between the parameters and the () in the function type ("void(int, int)") but the commit message says "void( int, int )" -> "void( int, int)", neither of which is what the test case tests, right? > > On Mon, Oct 26, 2015 at 5:44 PM, David Blaikie <dblai...@gmail.com> wrote: > >> >> >> On Mon, Oct 26, 2015 at 5:08 AM, Daniel Jasper via cfe-commits < >> cfe-commits@lists.llvm.org> wrote: >> >>> Author: djasper >>> Date: Mon Oct 26 07:08:47 2015 >>> New Revision: 251284 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=251284&view=rev >>> Log: >>> clang-format: Fix false positive in cast detection. >>> >>> Before (with spaces in parentheses): >>> void inFunction() { std::function<void( int, int )> fct; } >>> >>> After: >>> void inFunction() { std::function<void( int, int)> fct; } >>> >> >> I take it the typo in ^ between the "(" and the "int" is just a typo in >> the commit message, not reflected in the actual behavior? (judging by the >> test that seems to be the case) >> >> >>> >>> Modified: >>> cfe/trunk/lib/Format/TokenAnnotator.cpp >>> cfe/trunk/unittests/Format/FormatTest.cpp >>> >>> Modified: cfe/trunk/lib/Format/TokenAnnotator.cpp >>> URL: >>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/TokenAnnotator.cpp?rev=251284&r1=251283&r2=251284&view=diff >>> >>> ============================================================================== >>> --- cfe/trunk/lib/Format/TokenAnnotator.cpp (original) >>> +++ cfe/trunk/lib/Format/TokenAnnotator.cpp Mon Oct 26 07:08:47 2015 >>> @@ -1086,7 +1086,8 @@ private: >>> Tok.Previous->isOneOf(TT_PointerOrReference, TT_TemplateCloser) >>> || >>> Tok.Previous->isSimpleTypeSpecifier(); >>> bool ParensCouldEndDecl = >>> - Tok.Next && Tok.Next->isOneOf(tok::equal, tok::semi, >>> tok::l_brace); >>> + Tok.Next && >>> + Tok.Next->isOneOf(tok::equal, tok::semi, tok::l_brace, >>> tok::greater); >>> bool IsSizeOfOrAlignOf = >>> LeftOfParens && LeftOfParens->isOneOf(tok::kw_sizeof, >>> tok::kw_alignof); >>> if (ParensAreType && !ParensCouldEndDecl && !IsSizeOfOrAlignOf && >>> >>> Modified: cfe/trunk/unittests/Format/FormatTest.cpp >>> URL: >>> http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTest.cpp?rev=251284&r1=251283&r2=251284&view=diff >>> >>> ============================================================================== >>> --- cfe/trunk/unittests/Format/FormatTest.cpp (original) >>> +++ cfe/trunk/unittests/Format/FormatTest.cpp Mon Oct 26 07:08:47 2015 >>> @@ -8398,6 +8398,8 @@ TEST_F(FormatTest, ConfigurableSpacesInP >>> verifyFormat("call( x, y, z );", Spaces); >>> verifyFormat("call();", Spaces); >>> verifyFormat("std::function<void( int, int )> callback;", Spaces); >>> + verifyFormat("void inFunction() { std::function<void( int, int )> >>> fct; }", >>> + Spaces); >>> verifyFormat("while ( (bool)1 )\n" >>> " continue;", >>> Spaces); >>> @@ -10633,6 +10635,9 @@ TEST_F(FormatTest, SpacesInAngles) { >>> verifyFormat("f< int, float >();", Spaces); >>> verifyFormat("template <> g() {}", Spaces); >>> verifyFormat("template < std::vector< int > > f() {}", Spaces); >>> + verifyFormat("std::function< void(int, int) > fct;", Spaces); >>> + verifyFormat("void inFunction() { std::function< void(int, int) > >>> fct; }", >>> + Spaces); >>> >>> Spaces.Standard = FormatStyle::LS_Cpp03; >>> Spaces.SpacesInAngles = true; >>> >>> >>> _______________________________________________ >>> cfe-commits mailing list >>> cfe-commits@lists.llvm.org >>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits >>> >> >> >
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits