[cfe-commits] r83710 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/Sema.h lib/Sema/SemaDeclCXX.cpp lib/Sema/SemaExprCXX.cpp lib/Sema/SemaType.cpp test/SemaCXX/exception-spec.cpp

Sebastian Redl sebastian.redl at getdesigned.at
Mon Oct 12 13:52:19 PDT 2009


Douglas Gregor wrote:
>
> On Oct 10, 2009, at 5:04 AM, Sebastian Redl wrote:
>> +def err_incompatible_exception_specs : Error<
>> +  "target exception specification is not superset of source">;
>
> It would be nice if we said a little more about what types the target
> is missing in its exception specification, but it's not critical.
I'm still hoping for location information in the types, so that I can
simply make the caret diagnostics point to the types that don't fit.
>
>> +bool Sema::CheckExceptionSpecCompatibility(Expr *From, QualType ToType)
>> +{
>> +  // First we check for applicability.
>> +  // Target type must be a function, function pointer or function
>> reference.
>> +  if (const PointerType *PtrTy = ToType->getAs<PointerType>())
>> +    ToType = PtrTy->getPointeeType();
>> +  else if (const ReferenceType *RefTy = ToType->getAs<ReferenceType>())
>> +    ToType = RefTy->getPointeeType();
>
> Or a member function pointer?
Possibly. I have to check the standard and write a test case.

Thanks for the review.

Sebastian



More information about the cfe-commits mailing list