From: Richard Smith Date: Sun, 27 Jul 2014 05:38:12 +0000 (+0000) Subject: Fix default argument comma disambiguation bug following the 'template' keyword. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=66829d2b3955d61a633349869632611161789840;p=clang Fix default argument comma disambiguation bug following the 'template' keyword. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214051 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Parse/ParseCXXInlineMethods.cpp b/lib/Parse/ParseCXXInlineMethods.cpp index 30a9120a51..55caa5e59f 100644 --- a/lib/Parse/ParseCXXInlineMethods.cpp +++ b/lib/Parse/ParseCXXInlineMethods.cpp @@ -1014,6 +1014,7 @@ bool Parser::ConsumeAndStoreInitializer(CachedTokens &Toks, Toks.push_back(Tok); ConsumeToken(); if (Tok.is(tok::less)) { + ++AngleCount; ++KnownTemplateCount; Toks.push_back(Tok); ConsumeToken(); diff --git a/test/Parser/cxx-ambig-init-templ.cpp b/test/Parser/cxx-ambig-init-templ.cpp index ac79f77e15..1f69266413 100644 --- a/test/Parser/cxx-ambig-init-templ.cpp +++ b/test/Parser/cxx-ambig-init-templ.cpp @@ -169,3 +169,9 @@ namespace ElaboratedTypeSpecifiers { enum E {}; }; } + +namespace PR20459 { + template struct A { + void foo(int = EncTraits::template TypeEnc::val); // ok + }; +}