Index: lib/Lex/PPExpressions.cpp =================================================================== --- lib/Lex/PPExpressions.cpp +++ lib/Lex/PPExpressions.cpp @@ -310,7 +310,9 @@ // Set the value. Val = Literal.getValue(); // Set the signedness. UTF-16 and UTF-32 are always unsigned - if (!Literal.isUTF16() && !Literal.isUTF32()) + if (Literal.isWide()) + Val.setIsUnsigned(!TargetInfo::isTypeSigned(TI.getWCharType())); + else if (!Literal.isUTF16() && !Literal.isUTF32()) Val.setIsUnsigned(!PP.getLangOpts().CharIsSigned); if (Result.Val.getBitWidth() > Val.getBitWidth()) { Index: test/Preprocessor/pr19649-signed-wchar_t.c =================================================================== --- test/Preprocessor/pr19649-signed-wchar_t.c +++ test/Preprocessor/pr19649-signed-wchar_t.c @@ -0,0 +1,6 @@ +// RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -E -x c %s +// RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -E -fno-signed-char -x c %s + +#if (L'\0' - 1 > 0) +# error "Unexpected expression evaluation result" +#endif Index: test/Preprocessor/pr19649-unsigned-wchar_t.c =================================================================== --- test/Preprocessor/pr19649-unsigned-wchar_t.c +++ test/Preprocessor/pr19649-unsigned-wchar_t.c @@ -0,0 +1,6 @@ +// RUN: %clang_cc1 -triple i386-pc-cygwin -E -x c %s +// RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -E -fshort-wchar -x c %s + +#if (L'\0' - 1 < 0) +# error "Unexpected expression evaluation result" +#endif