diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-12-18 21:39:37 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-12-18 21:39:37 +0000 |
commit | b35fdac51f5f90b06f0597465fc525f6f64a0f08 (patch) | |
tree | 2e273e35e34858cd8ef934a9436bbfbf56a58304 /include | |
parent | 7f60b40f08d9c4f13f9b5a7cbbd98468d3345100 (diff) |
Fix some interactions between C++11 and C++14 features and using-declarations:
* a dependent non-type using-declaration within a function template can be
valid, as it can refer to an enumerator, so don't reject it in the template
definition
* we can partially substitute into a dependent using-declaration if it appears
within a (local class in a) generic lambda within a function template, which
means an UnresolvedUsing*Decl doesn't necessarily instantiate to a UsingDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290071 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/AST/ASTContext.h | 12 | ||||
-rw-r--r-- | include/clang/Sema/Sema.h | 1 |
2 files changed, 7 insertions, 6 deletions
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h index a07f412682..f2aceab41c 100644 --- a/include/clang/AST/ASTContext.h +++ b/include/clang/AST/ASTContext.h @@ -398,11 +398,11 @@ private: llvm::DenseMap<const VarDecl *, TemplateOrSpecializationInfo> TemplateOrInstantiation; - /// \brief Keeps track of the declaration from which a UsingDecl was + /// \brief Keeps track of the declaration from which a using declaration was /// created during instantiation. /// - /// The source declaration is always a UsingDecl, an UnresolvedUsingValueDecl, - /// or an UnresolvedUsingTypenameDecl. + /// The source and target declarations are always a UsingDecl, an + /// UnresolvedUsingValueDecl, or an UnresolvedUsingTypenameDecl. /// /// For example: /// \code @@ -421,7 +421,7 @@ private: /// /// This mapping will contain an entry that maps from the UsingDecl in /// B<int> to the UnresolvedUsingDecl in B<T>. - llvm::DenseMap<UsingDecl *, NamedDecl *> InstantiatedFromUsingDecl; + llvm::DenseMap<NamedDecl *, NamedDecl *> InstantiatedFromUsingDecl; llvm::DenseMap<UsingShadowDecl*, UsingShadowDecl*> InstantiatedFromUsingShadowDecl; @@ -849,11 +849,11 @@ public: /// \brief If the given using decl \p Inst is an instantiation of a /// (possibly unresolved) using decl from a template instantiation, /// return it. - NamedDecl *getInstantiatedFromUsingDecl(UsingDecl *Inst); + NamedDecl *getInstantiatedFromUsingDecl(NamedDecl *Inst); /// \brief Remember that the using decl \p Inst is an instantiation /// of the using decl \p Pattern of a class template. - void setInstantiatedFromUsingDecl(UsingDecl *Inst, NamedDecl *Pattern); + void setInstantiatedFromUsingDecl(NamedDecl *Inst, NamedDecl *Pattern); void setInstantiatedFromUsingShadowDecl(UsingShadowDecl *Inst, UsingShadowDecl *Pattern); diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index 2b54d5ee14..136f848338 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -4317,6 +4317,7 @@ public: SourceLocation NameLoc, const LookupResult &Previous); bool CheckUsingDeclQualifier(SourceLocation UsingLoc, + bool HasTypename, const CXXScopeSpec &SS, const DeclarationNameInfo &NameInfo, SourceLocation NameLoc); |