Test MakeArg and fix formatting.

This commit is contained in:
Victor Zverovich
2014-07-03 08:50:57 -07:00
parent 43a873f7ff
commit 4e260e8599
4 changed files with 68 additions and 59 deletions
+7 -7
View File
@@ -29,9 +29,12 @@ expect_compile_error("fmt::internal::Array<char, 5> a, b; b = a;")
expect_compile_error("const fmt::Writer a, b(a);")
expect_compile_error("fmt::Writer a, b; b = a;")
# Formatter is not copyable from a temporary.
expect_compile_error("fmt::Formatter<> a(fmt::Formatter<>(\"a\"));")
expect_compile_error("fmt::Formatter<> b(\"a\"); b = fmt::Formatter<>(\"b\");")
# MakeArg doesn't accept [const] volatile char *.
expect_compile_error("volatile char s[] = \"test\"; (fmt::internal::MakeArg<char>)(s);")
expect_compile_error("const volatile char s[] = \"test\"; (fmt::internal::MakeArg<char>)(s);")
# MakeArg<char> doesn't accept wchar_t.
expect_compile_error("fmt::internal::MakeArg<char>(L'a');")
# Writing a wide character to a character stream Writer is forbidden.
expect_compile_error("fmt::Writer() << L'a';")
@@ -39,7 +42,4 @@ expect_compile_error("fmt::Writer() << fmt::pad(\"abc\", 5, L' ');")
expect_compile_error("fmt::Writer() << fmt::pad(42, 5, L' ');")
# Formatting a wide character with a narrow format string is forbidden.
expect_compile_error("fmt::Format(\"{}\") << L'a';")
# There is no implicit conversion from FILE* to FileSink.
expect_compile_error("fmt::FileSink fs = 0;")
expect_compile_error("fmt::format(\"{}\", L'a';")