diff options
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 3c6f706f15..77460359f4 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -3807,6 +3807,14 @@ FieldDecl *Sema::HandleField(Scope *S, RecordDecl *Record, Diag(D.getDeclSpec().getThreadSpecLoc(), diag::err_invalid_thread); NamedDecl *PrevDecl = LookupName(S, II, LookupMemberName, true); + + if (PrevDecl && PrevDecl->isTemplateParameter()) { + // Maybe we will complain about the shadowed template parameter. + DiagnoseTemplateParameterShadow(D.getIdentifierLoc(), PrevDecl); + // Just pretend that we didn't see the previous declaration. + PrevDecl = 0; + } + if (PrevDecl && !isDeclInScope(PrevDecl, Record, S)) PrevDecl = 0; |