diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-10-14 14:59:48 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-10-14 14:59:48 +0000 |
commit | 7eb5d377d7bc0c3a786563bcdb22e2edbd8565ed (patch) | |
tree | 33c26c6664aad660442ca9c3551564d20c17e61b /clang/lib/Sema/SemaExceptionSpec.cpp | |
parent | 075b21d4dc39ad89f0e1ceaf11f6438d1c29fec6 (diff) | |
download | bcm5719-llvm-7eb5d377d7bc0c3a786563bcdb22e2edbd8565ed.tar.gz bcm5719-llvm-7eb5d377d7bc0c3a786563bcdb22e2edbd8565ed.zip |
Use partial diagnostics properly in call to RequireCompleteType. Among other things, this means we get a note on the declaration of the incomplete type when it is used in an exception specification.
llvm-svn: 84099
Diffstat (limited to 'clang/lib/Sema/SemaExceptionSpec.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExceptionSpec.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/clang/lib/Sema/SemaExceptionSpec.cpp b/clang/lib/Sema/SemaExceptionSpec.cpp index 261bebf9553..12d06b4905b 100644 --- a/clang/lib/Sema/SemaExceptionSpec.cpp +++ b/clang/lib/Sema/SemaExceptionSpec.cpp @@ -41,11 +41,9 @@ bool Sema::CheckSpecifiedExceptionType(QualType T, const SourceRange &Range) { // C++ 15.4p2: A type denoted in an exception-specification shall not denote // an incomplete type. - // FIXME: This isn't right. This will supress diagnostics from template - // instantiation and then simply emit the invalid type diagnostic. - if (RequireCompleteType(Range.getBegin(), T, 0)) - return Diag(Range.getBegin(), diag::err_incomplete_in_exception_spec) - << Range << T << /*direct*/0; + if (RequireCompleteType(Range.getBegin(), T, + PDiag(diag::err_incomplete_in_exception_spec) << /*direct*/0 << Range)) + return true; // C++ 15.4p2: A type denoted in an exception-specification shall not denote // an incomplete type a pointer or reference to an incomplete type, other @@ -60,9 +58,9 @@ bool Sema::CheckSpecifiedExceptionType(QualType T, const SourceRange &Range) { } else return false; - if (!T->isVoidType() && RequireCompleteType(Range.getBegin(), T, 0)) - return Diag(Range.getBegin(), diag::err_incomplete_in_exception_spec) - << Range << T << /*indirect*/kind; + if (!T->isVoidType() && RequireCompleteType(Range.getBegin(), T, + PDiag(diag::err_incomplete_in_exception_spec) << /*direct*/kind << Range)) + return true; return false; } |