https://llvm.org/bugs/show_bug.cgi?id=26225
Bug ID: 26225 Summary: static_assert does not respect new-lines Product: new-bugs Version: unspecified Hardware: PC OS: All Status: NEW Severity: normal Priority: P Component: new bugs Assignee: unassignedb...@nondot.org Reporter: metaprogrammingthewo...@gmail.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified This may or may not be considered a bug -- when a static_assert message contains a '\n' character, the text "\n" is currently printed as opposed to an actual new line. This is more unfortunate than it might seem because spacing and new lines in static_assert messages can greatly improve the readability of user-provided error messages. Notably, GCC prints an actual new line when the new-line character is encountered. Example: //////////////////// static_assert(false, "\n****************************************\n" "Error: The third macro argument that was " "provided to FOO is invalid (it was not parenthesized). Saw:\n" "std::array<int, 5>\n" "Did you mean:\n" "(std::array<int, 5>)" "\n****************************************\n"); int main() {} //////////////////// In GCC, this nicely prints: 1 : error: static assertion failed: **************************************** Error: The third macro argument that was provided to FOO is invalid (it was not parenthesized). Saw: std::array<int, 5> Did you mean: (std::array<int, 5>) **************************************** While in Clang, this prints: 1 : error: static_assert failed "\n****************************************\nError: The third macro argument that was provided to FOO is invalid (it was not parenthesized). Saw:\nstd::array<int, 5>\nDid you mean:\n(std::array<int, 5>)\n****************************************\n" -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs