diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-07-27 05:38:12 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-07-27 05:38:12 +0000 |
commit | 9303357e73d034b9f22b459f92028583231e8746 (patch) | |
tree | 9e2654676404b9b4ee1b6bd7a743a71691896b36 | |
parent | 4137af286f7f547ee81349da5130e4b155232531 (diff) | |
download | bcm5719-llvm-9303357e73d034b9f22b459f92028583231e8746.tar.gz bcm5719-llvm-9303357e73d034b9f22b459f92028583231e8746.zip |
Fix default argument comma disambiguation bug following the 'template' keyword.
llvm-svn: 214051
-rw-r--r-- | clang/lib/Parse/ParseCXXInlineMethods.cpp | 1 | ||||
-rw-r--r-- | clang/test/Parser/cxx-ambig-init-templ.cpp | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseCXXInlineMethods.cpp b/clang/lib/Parse/ParseCXXInlineMethods.cpp index 30a9120a510..55caa5e59f6 100644 --- a/clang/lib/Parse/ParseCXXInlineMethods.cpp +++ b/clang/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/clang/test/Parser/cxx-ambig-init-templ.cpp b/clang/test/Parser/cxx-ambig-init-templ.cpp index ac79f77e152..1f692664137 100644 --- a/clang/test/Parser/cxx-ambig-init-templ.cpp +++ b/clang/test/Parser/cxx-ambig-init-templ.cpp @@ -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 + }; +} |