[cfe-commits] r132750 - in /cfe/trunk: lib/Sema/SemaExpr.cpp test/Parser/opencl-astype.cl

Peter Collingbourne peter at pcc.me.uk
Wed Jun 8 08:15:18 PDT 2011


Author: pcc
Date: Wed Jun  8 10:15:17 2011
New Revision: 132750

URL: http://llvm.org/viewvc/llvm-project?rev=132750&view=rev
Log:
Modify a diagnostic introduced in r132612 to emit QualTypes directly

This fixes a memory error on FreeBSD (and is the right thing to do
in any case).

Modified:
    cfe/trunk/lib/Sema/SemaExpr.cpp
    cfe/trunk/test/Parser/opencl-astype.cl

Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=132750&r1=132749&r2=132750&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Wed Jun  8 10:15:17 2011
@@ -5009,8 +5009,8 @@
   if (Context.getTypeSize(DstTy) != Context.getTypeSize(SrcTy))
     return ExprError(Diag(BuiltinLoc,
                           diag::err_invalid_astype_of_different_size)
-                     << DstTy.getAsString().c_str() 
-                     << SrcTy.getAsString().c_str()
+                     << DstTy
+                     << SrcTy
                      << expr->getSourceRange());
   return Owned(new (Context) AsTypeExpr(expr, DstTy, VK, OK, BuiltinLoc, RParenLoc));
 }

Modified: cfe/trunk/test/Parser/opencl-astype.cl
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/opencl-astype.cl?rev=132750&r1=132749&r2=132750&view=diff
==============================================================================
--- cfe/trunk/test/Parser/opencl-astype.cl (original)
+++ cfe/trunk/test/Parser/opencl-astype.cl Wed Jun  8 10:15:17 2011
@@ -11,10 +11,10 @@
   typedef __attribute__(( ext_vector_type(4) ))  double double4;
   
   float4 f4;
-  double4 d4 = __builtin_astype(f4, double4); // expected-error{{invalid reinterpretation: sizes of double4 and float4 must match}}
+  double4 d4 = __builtin_astype(f4, double4); // expected-error{{invalid reinterpretation: sizes of 'double4' and 'float4' must match}}
   
   // Verify int4->float3, float3->int4 works.
   int4 i4;
   float3 f3 = __builtin_astype(i4, float3);
   i4 = __builtin_astype(f3, int4);
-}
\ No newline at end of file
+}





More information about the cfe-commits mailing list