Index: clang/lib/Sema/SemaChecking.cpp =================================================================== --- clang/lib/Sema/SemaChecking.cpp +++ clang/lib/Sema/SemaChecking.cpp @@ -14281,6 +14281,11 @@ } } + if (SourceBT && SourceBT->isInteger() && TargetBT && + TargetBT->isInteger()) { + return; + } + // Fall through for non-constants to give a sign conversion warning. } Index: clang/test/Sema/sign-conversion.c =================================================================== --- clang/test/Sema/sign-conversion.c +++ clang/test/Sema/sign-conversion.c @@ -5,4 +5,8 @@ void test(int x) { unsigned t0 = x; // expected-warning {{implicit conversion changes signedness}} unsigned t1 = (t0 == 5 ? x : 0); // expected-warning {{operand of ? changes signedness}} + + // Clang has special treatment for left shift of literal '1'. + // Make sure there is no diagnostics. + long t2 = 1LL << x; }