Index: clang/include/clang/Basic/DiagnosticLexKinds.td =================================================================== --- clang/include/clang/Basic/DiagnosticLexKinds.td +++ clang/include/clang/Basic/DiagnosticLexKinds.td @@ -106,7 +106,7 @@ def ext_multichar_character_literal : Warning< "multi-character character constant">, InGroup; -def ext_four_char_character_literal : Warning< +def ext_four_char_character_literal : Remark< "multi-character character constant">, InGroup; Index: clang/test/CXX/lex/lex.literal/lex.ccon/p1.cpp =================================================================== --- clang/test/CXX/lex/lex.literal/lex.ccon/p1.cpp +++ clang/test/CXX/lex/lex.literal/lex.ccon/p1.cpp @@ -1,12 +1,12 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s -// Expect the warning of the four-character character constant after changing it from extension to implementation-defined +// expected-no-diagnostics // Check types of char literals extern char a; extern __typeof('a') a; extern int b; -extern __typeof('asdf') b; // expected-warning {{multi-character character constant}} +extern __typeof('asdf') b; extern wchar_t c; extern __typeof(L'a') c; #if __cplusplus >= 201103L Index: clang/test/FixIt/format.m =================================================================== --- clang/test/FixIt/format.m +++ clang/test/FixIt/format.m @@ -162,16 +162,13 @@ NSLog(@"%s", 'abcd'); // expected-warning{{format specifies type 'char *' but the argument has type 'int'}} \ - // expected-warning {{multi-character character constant}} - // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:11-[[@LINE-2]]:13}:"%d" + // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:11-[[@LINE-1]]:13}:"%d" NSLog(@"%lf", 'abcd'); // expected-warning{{format specifies type 'double' but the argument has type 'int'}} \ - // expected-warning {{multi-character character constant}} - // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:11-[[@LINE-2]]:14}:"%d" + // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:11-[[@LINE-1]]:14}:"%d" NSLog(@"%@", 'abcd'); // expected-warning{{format specifies type 'id' but the argument has type 'int'}} \ - // expected-warning {{multi-character character constant}} - // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:11-[[@LINE-2]]:13}:"%d" + // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:11-[[@LINE-1]]:13}:"%d" } void multichar_constants_false_negative() { @@ -181,8 +178,7 @@ // many C library functions like fgetc() actually return an int (using -1 // as a sentinel). NSLog(@"%c", 'abcd'); // missing-warning{{format specifies type 'char' but the argument has type 'int'}} \ - // expected-warning {{multi-character character constant}} - // CHECK-NOT: fix-it:"{{.*}}":{[[@LINE-2]]:11-[[@LINE-2]]:13}:"%d" + // CHECK-NOT: fix-it:"{{.*}}":{[[@LINE-1]]:11-[[@LINE-1]]:13}:"%d" } Index: clang/test/Lexer/char-literal.cpp =================================================================== --- clang/test/Lexer/char-literal.cpp +++ clang/test/Lexer/char-literal.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -Wfour-char-constants -fsyntax-only -verify %s -// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c11 -x c -Wfour-char-constants -fsyntax-only -verify %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -fsyntax-only -verify %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c11 -x c -fsyntax-only -verify %s #ifndef __cplusplus typedef __WCHAR_TYPE__ wchar_t; @@ -9,7 +9,7 @@ int a = 'ab'; // expected-warning {{multi-character character constant}} int b = '\xFF\xFF'; // expected-warning {{multi-character character constant}} -int c = 'APPS'; // expected-warning {{multi-character character constant}} +int c = 'APPS'; char d = '鈱?; // expected-error {{character too large for enclosing character literal type}} char e = '\u2318'; // expected-error {{character too large for enclosing character literal type}} Index: clang/test/Lexer/constants.c =================================================================== --- clang/test/Lexer/constants.c +++ clang/test/Lexer/constants.c @@ -26,7 +26,7 @@ '\\ t', '??!', // expected-warning {{trigraph converted to '|' character}} - 'abcd' // expected-warning {{multi-character character constant}} + 'abcd' }; // PR4499 @@ -36,15 +36,16 @@ int m3 = '\\\ '; +// The four-character character constants wouldn't cause warning anymore after we change it to "Remark" #pragma clang diagnostic ignored "-Wmultichar" int d = 'df'; // no warning. -int e = 'abcd'; // still warn: expected-warning {{multi-character character constant}} +int e = 'abcd'; -#pragma clang diagnostic ignored "-Wfour-char-constants" +// #pragma clang diagnostic ignored "-Wfour-char-constants" -int f = 'abcd'; // ignored. +int f = 'abcd'; // rdar://problem/6974641 float t0[] = { Index: clang/test/Lexer/multi-character-character-constant.c =================================================================== --- clang/test/Lexer/multi-character-character-constant.c +++ clang/test/Lexer/multi-character-character-constant.c @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -fsyntax-only -verify -pedantic-errors %s int x = 'ab'; // expected-warning {{multi-character character constant}} -int y = 'abcd'; // expected-warning {{multi-character character constant}} +int y = 'abcd'; // no warning. int main() { return 0; Index: clang/test/Preprocessor/expr_multichar.c =================================================================== --- clang/test/Preprocessor/expr_multichar.c +++ clang/test/Preprocessor/expr_multichar.c @@ -1,6 +1,6 @@ // RUN: %clang_cc1 < %s -E -verify -triple i686-pc-linux-gnu -// Expect the warning of the four-character character constant after changing it from extension to implementation-defined +// expected-no-diagnostics -#if (('1234' >> 24) != '1') // expected-warning {{multi-character character constant}} +#if (('1234' >> 24) != '1') #error Bad multichar constant calculation! #endif