def : DiagGroup<"missing-declarations">;
def : DiagGroup<"missing-format-attribute">;
def : DiagGroup<"missing-noreturn">;
+def MultiChar : DiagGroup<"multichar">;
def : DiagGroup<"nested-externs">;
def : DiagGroup<"newline-eof">;
def : DiagGroup<"format-y2k">;
def Most : DiagGroup<"most", [
Comment,
Implicit,
+ MultiChar,
Switch,
Trigraphs,
Uninitialized,
def err_unterminated_block_comment : Error<"unterminated /* comment">;
def err_invalid_character_to_charify : Error<
"invalid argument to convert to character">;
+def ext_multichar_character_literal : ExtWarn<
+ "multi-character character constant">, InGroup<MultiChar>;
// Literal
def ext_nonstandard_escape : Extension<
// constants (L'abcd').
if (IsWide)
PP.Diag(Loc, diag::warn_extraneous_wide_char_constant);
+ else
+ PP.Diag(Loc, diag::ext_multichar_character_literal);
}
if (IsWide) {
// Narrow character literals act as though their value is concatenated
// in this implementation.
if ((LitVal.shl(8)).lshr(8) != LitVal)
- // if (((LitVal << 8) >> 8) != LitVal)
PP.Diag(Loc, diag::warn_char_constant_too_large);
LitVal <<= 8;
}
-// RUN: clang-cc -fsyntax-only -verify %s
+// RUN: clang-cc -fsyntax-only -verify -pedantic -trigraphs %s
int x = 000000080; // expected-error {{invalid digit}}
// PR2252
#if -0x8000000000000000 // should not warn.
#endif
+
+
+char c[] = {
+ 'df', // expected-warning {{multi-character character constant}}
+ '\t',
+ '\\
+t',
+ '??!' // expected-warning {{trigraph converted to '|' character}}
+};
+
+
+#pragma GCC diagnostic ignored "-Wmultichar"
+
+char d = 'df'; // no warning.