]> granicus.if.org Git - clang/commitdiff
Fix default argument comma disambiguation bug following the 'template' keyword.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Sun, 27 Jul 2014 05:38:12 +0000 (05:38 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Sun, 27 Jul 2014 05:38:12 +0000 (05:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214051 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseCXXInlineMethods.cpp
test/Parser/cxx-ambig-init-templ.cpp

index 30a9120a5106435942306531189b06f86c5aa447..55caa5e59f6e2ec11b78a051c4333298a3697f62 100644 (file)
@@ -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();
index ac79f77e152db75f2af25e240e689da85721f84a..1f692664137c80b263c8c59ae32ad2d6c6d90bfe 100644 (file)
@@ -169,3 +169,9 @@ namespace ElaboratedTypeSpecifiers {
     enum E {};
   };
 }
+
+namespace PR20459 {
+  template <typename EncTraits> struct A {
+     void foo(int = EncTraits::template TypeEnc<int, int>::val); // ok
+  };
+}