From 5bb5e4ad9d8ed8ac59ae15c716fea9b34a88fd59 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 12 Oct 2010 23:32:35 +0000 Subject: Introduce support for emitting diagnostics (warnings + their notes) that are suppressed during template argument deduction. This change queues diagnostics computed during template argument deduction. Then, if the resulting function template specialization or partial specialization is chosen by overload resolution or partial ordering (respectively), we will emit the queued diagnostics at that point. This addresses most of PR6784. However, the check for unnamed/local template arguments (which existed before this change) is still only skin-deep, and needs to be extended to look deeper into types. It must be improved to finish PR6784. llvm-svn: 116373 --- clang/lib/Sema/SemaInit.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'clang/lib/Sema/SemaInit.cpp') diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp index 7f0f2767c64..1e48930f972 100644 --- a/clang/lib/Sema/SemaInit.cpp +++ b/clang/lib/Sema/SemaInit.cpp @@ -3765,6 +3765,7 @@ InitializationSequence::Perform(Sema &S, S.CheckDestructorAccess(CurInitExpr->getLocStart(), Destructor, S.PDiag(diag::err_access_dtor_temp) << T); S.MarkDeclarationReferenced(CurInitExpr->getLocStart(), Destructor); + S.DiagnoseUseOfDecl(Destructor, CurInitExpr->getLocStart()); } } @@ -3858,7 +3859,8 @@ InitializationSequence::Perform(Sema &S, unsigned NumExprs = ConstructorArgs.size(); Expr **Exprs = (Expr **)ConstructorArgs.take(); S.MarkDeclarationReferenced(Loc, Constructor); - + S.DiagnoseUseOfDecl(Constructor, Loc); + TypeSourceInfo *TSInfo = Entity.getTypeSourceInfo(); if (!TSInfo) TSInfo = S.Context.getTrivialTypeSourceInfo(Entity.getType(), Loc); -- cgit v1.2.3