From de756fbbd711a0b5c8c05e6817f35307d496eec4 Mon Sep 17 00:00:00 2001 From: Richard Trieu Date: Sat, 7 May 2011 01:36:37 +0000 Subject: Patch for PR 7409 - only error on definition of invalid typedefs. Suppress errors for additional uses of this invalid typedef. llvm-svn: 131043 --- clang/lib/Sema/TreeTransform.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'clang/lib/Sema') diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h index da60fccf7ed..c45d02a56c6 100644 --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -2568,9 +2568,13 @@ TreeTransform::TransformNestedNameSpecifierLoc( Q.getLocalEndLoc()); break; } - - SemaRef.Diag(TL.getBeginLoc(), diag::err_nested_name_spec_non_tag) - << TL.getType() << SS.getRange(); + // If the nested-name-specifier is an invalid type def, don't emit an + // error because a previous error should have already been emitted. + TypedefTypeLoc* TTL = dyn_cast(&TL); + if (!TTL || !TTL->getTypedefNameDecl()->isInvalidDecl()) { + SemaRef.Diag(TL.getBeginLoc(), diag::err_nested_name_spec_non_tag) + << TL.getType() << SS.getRange(); + } return NestedNameSpecifierLoc(); } } -- cgit v1.2.3