aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExceptionSpec.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2009-10-14 14:59:48 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2009-10-14 14:59:48 +0000
commit491b84c062ead1c69911a8d5f0d57826afacc099 (patch)
tree323608facb5747dd2e33edeaf580023088bf9c49 /lib/Sema/SemaExceptionSpec.cpp
parentc3a3b7b38440384944614ea6e93cf8d238d3d5f2 (diff)
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84099 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExceptionSpec.cpp')
-rw-r--r--lib/Sema/SemaExceptionSpec.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/Sema/SemaExceptionSpec.cpp b/lib/Sema/SemaExceptionSpec.cpp
index 261bebf955..12d06b4905 100644
--- a/lib/Sema/SemaExceptionSpec.cpp
+++ b/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;
}