diff options
author | Alex Lorenz <arphaman@gmail.com> | 2017-06-27 10:35:30 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2017-06-27 10:35:30 +0000 |
commit | 99bee7f4a174a2f7a7394b70cc6877be6017a21c (patch) | |
tree | 3a541a5ff39810ee9619c532ea50a5c30ec4461f /clang/lib | |
parent | 4ccd99541bfc8f4f475dbacd1d17dc9817e92b1e (diff) | |
download | bcm5719-llvm-99bee7f4a174a2f7a7394b70cc6877be6017a21c.tar.gz bcm5719-llvm-99bee7f4a174a2f7a7394b70cc6877be6017a21c.zip |
Recommit r306103: PR26195: Set correct NestedNameSpecifierLoc for the
dependent initializer
This commit fixes incorrect source positions of dependent c'tor initializers
like in the following code:
template<typename MyBase>
struct Derived: MyBase::InnerIterator
{
Derived() : MyBase::InnerIterator() {} /// This line is problematic: all positions point to InnerIterator and nothing points to MyBase
};
Patch by Serge Preis!
Differential Revision: https://reviews.llvm.org/D32439
llvm-svn: 306392
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 453ece9d9c4..e9070881afe 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -3778,6 +3778,15 @@ Sema::BuildMemInitializer(Decl *ConstructorD, if (BaseType.isNull()) return true; + TInfo = Context.CreateTypeSourceInfo(BaseType); + DependentNameTypeLoc TL = + TInfo->getTypeLoc().castAs<DependentNameTypeLoc>(); + if (!TL.isNull()) { + TL.setNameLoc(IdLoc); + TL.setElaboratedKeywordLoc(SourceLocation()); + TL.setQualifierLoc(SS.getWithLocInContext(Context)); + } + R.clear(); R.setLookupName(MemberOrBase); } |