@@ -80,17 +80,21 @@ class ErrorReporter {
8080 // / Print \p Format, instantiated with \p Args to stderr.
8181 // / TODO: Allow redirection into a file stream.
8282 template <typename ... ArgsTy>
83- [[gnu::format(__printf__, 1 , 2 )]] static void print (const char *Format,
84- ArgsTy &&...Args) {
83+ #ifdef __clang__ // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77958
84+ [[gnu::format(__printf__, 1 , 2 )]]
85+ #endif
86+ static void print (const char *Format, ArgsTy &&...Args) {
8587 raw_fd_ostream OS (STDERR_FILENO, false );
8688 OS << llvm::format (Format, Args...);
8789 }
8890
8991 // / Print \p Format, instantiated with \p Args to stderr, but colored.
9092 // / TODO: Allow redirection into a file stream.
9193 template <typename ... ArgsTy>
92- [[gnu::format(__printf__, 2 , 3 )]] static void
93- print (ColorTy Color, const char *Format, ArgsTy &&...Args) {
94+ #ifdef __clang__ // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77958
95+ [[gnu::format(__printf__, 2 , 3 )]]
96+ #endif
97+ static void print (ColorTy Color, const char *Format, ArgsTy &&...Args) {
9498 raw_fd_ostream OS (STDERR_FILENO, false );
9599 WithColor (OS, HighlightColor (Color)) << llvm::format (Format, Args...);
96100 }
@@ -99,8 +103,10 @@ class ErrorReporter {
99103 // / a banner.
100104 // / TODO: Allow redirection into a file stream.
101105 template <typename ... ArgsTy>
102- [[gnu::format(__printf__, 1 , 2 )]] static void reportError (const char *Format,
103- ArgsTy &&...Args) {
106+ #ifdef __clang__ // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77958
107+ [[gnu::format(__printf__, 1 , 2 )]]
108+ #endif
109+ static void reportError (const char *Format, ArgsTy &&...Args) {
104110 print (BoldRed, " %s" , ErrorBanner);
105111 print (BoldRed, Format, Args...);
106112 print (" \n " );
0 commit comments