]> granicus.if.org Git - clang/commitdiff
Revert r205646 (keeping the test in its modified form) as
authorFariborz Jahanian <fjahanian@apple.com>
Mon, 7 Apr 2014 16:32:54 +0000 (16:32 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Mon, 7 Apr 2014 16:32:54 +0000 (16:32 +0000)
it is subsumed by r205521.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205718 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaChecking.cpp
test/Sema/conversion.c

index 9cd44d2cae36d0c985fae3e8ad3b4e0c175b9bf2..b824ec4825b5b88aaeb48eeabc77ada62893ced7 100644 (file)
@@ -6113,21 +6113,12 @@ void CheckConditionalOperator(Sema &S, ConditionalOperator *E,
 /// implicit conversions in the given expression.  There are a couple
 /// of competing diagnostics here, -Wconversion and -Wsign-compare.
 void AnalyzeImplicitConversions(Sema &S, Expr *OrigE, SourceLocation CC) {
+  QualType T = OrigE->getType();
   Expr *E = OrigE->IgnoreParenImpCasts();
 
   if (E->isTypeDependent() || E->isValueDependent())
     return;
   
-  QualType T = OrigE->getType();
-  // Check for conversion from an arithmetic type to a vector of arithmetic
-  // type elements. Warn if this results in truncation of each vector element.
-  if (isa<ExtVectorElementExpr>(E)) {
-    if (ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(OrigE))
-      if ((ICE->getCastKind() == CK_VectorSplat) &&
-          !T.isNull() && T->isExtVectorType())
-        T = cast<ExtVectorType>(T.getCanonicalType())->getElementType();
-  }
-
   // For conditional operators, we analyze the arguments as if they
   // were being fed directly into the output.
   if (isa<ConditionalOperator>(E)) {
index 121f2d40bba2440f29031fb65e6d771f89cb4505..89c34c6a224ccd3d8fecc797bef89700f0f8722b 100644 (file)
@@ -426,6 +426,6 @@ typedef __attribute__ ((ext_vector_type( 8),__aligned__( 32))) uint32_t uint8;
 
 void test27(ushort16 constants) {
     uint8 pairedConstants = (uint8) constants;
-    ushort16 crCbScale = pairedConstants.s4; // expected-warning {{implicit conversion loses integer precision: 'uint32_t' (aka 'unsigned int') to 'unsigned short'}}
-    ushort16 brBias = pairedConstants.s6; // expected-warning {{implicit conversion loses integer precision: 'uint32_t' (aka 'unsigned int') to 'unsigned short'}}
+    ushort16 crCbScale = pairedConstants.s4; // expected-warning {{implicit conversion loses integer precision: 'uint32_t' (aka 'unsigned int') to 'ushort16'}}
+    ushort16 brBias = pairedConstants.s6; // expected-warning {{implicit conversion loses integer precision: 'uint32_t' (aka 'unsigned int') to 'ushort16'}}
 }