diff options
author | Erik Verbruggen <erikjv@me.com> | 2017-09-08 09:31:13 +0000 |
---|---|---|
committer | Erik Verbruggen <erikjv@me.com> | 2017-09-08 09:31:13 +0000 |
commit | 51ee12a9fbef806fd770151de343c563402de42b (patch) | |
tree | 7678bc903da2058bf820e36a88ec334ff95f6359 /clang/lib/Parse/ParseTemplate.cpp | |
parent | 113a5ca029c157ba6e69d97c8a042a3dabec783b (diff) | |
download | bcm5719-llvm-51ee12a9fbef806fd770151de343c563402de42b.tar.gz bcm5719-llvm-51ee12a9fbef806fd770151de343c563402de42b.zip |
Fix templated type alias completion when using global completion cache
When we have enabled cache for global completions we did not have
diagnostics for Bar and could not complete Ba as in provided code
example.
template <typename T>
struct Foo { T member; };
template<typename T> using Bar = Foo<T>;
int main() {
Ba
}
(This is the fixed version of r 311442, which was reverted in r311445.)
Patch by Ivan Donchevskii!
Differential Revision: https://reviews.llvm.org/D35355
llvm-svn: 312780
Diffstat (limited to 'clang/lib/Parse/ParseTemplate.cpp')
-rw-r--r-- | clang/lib/Parse/ParseTemplate.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Parse/ParseTemplate.cpp b/clang/lib/Parse/ParseTemplate.cpp index da0707f66ee..fcb1142b9c2 100644 --- a/clang/lib/Parse/ParseTemplate.cpp +++ b/clang/lib/Parse/ParseTemplate.cpp @@ -197,10 +197,11 @@ Parser::ParseSingleDeclarationAfterTemplate( MaybeParseCXX11Attributes(prefixAttrs); if (Tok.is(tok::kw_using)) { - // FIXME: We should return the DeclGroup to the caller. - ParseUsingDirectiveOrDeclaration(Context, TemplateInfo, DeclEnd, - prefixAttrs); - return nullptr; + auto usingDeclPtr = ParseUsingDirectiveOrDeclaration(Context, TemplateInfo, DeclEnd, + prefixAttrs); + if (!usingDeclPtr || !usingDeclPtr.get().isSingleDecl()) + return nullptr; + return usingDeclPtr.get().getSingleDecl(); } // Parse the declaration specifiers, stealing any diagnostics from |