[cfe-commits] r74247 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/Sema.h lib/Sema/SemaExpr.cpp test/Sema/ext_vector_casts.c test/Sema/vector-cast.c

Eli Friedman eli.friedman at gmail.com
Fri Jun 26 14:51:44 PDT 2009


On Thu, Jun 25, 2009 at 5:50 PM, Nate Begeman<natebegeman at mac.com> wrote:
> +  // If SrcTy is also an ExtVectorType, the types must be identical unless
> +  // lax vector conversions is enabled.
> +  if (SrcTy->isExtVectorType()) {
> +    if (getLangOptions().LaxVectorConversions &&
> +        Context.getTypeSize(DestTy) == Context.getTypeSize(SrcTy))
> +      return false;
> +    if (DestTy != SrcTy)
> +      return Diag(R.getBegin(),diag::err_invalid_conversion_between_ext_vectors)
> +      << DestTy << SrcTy << R;
> +    return false;
> +  }

LaxVectorConversions is supposed to control implicit conversions.  I
see no reason to disallow explicit conversions.

-Eli




More information about the cfe-commits mailing list