@@ -80,17 +80,21 @@ class ErrorReporter {
80
80
// / Print \p Format, instantiated with \p Args to stderr.
81
81
// / TODO: Allow redirection into a file stream.
82
82
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) {
85
87
raw_fd_ostream OS (STDERR_FILENO, false );
86
88
OS << llvm::format (Format, Args...);
87
89
}
88
90
89
91
// / Print \p Format, instantiated with \p Args to stderr, but colored.
90
92
// / TODO: Allow redirection into a file stream.
91
93
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) {
94
98
raw_fd_ostream OS (STDERR_FILENO, false );
95
99
WithColor (OS, HighlightColor (Color)) << llvm::format (Format, Args...);
96
100
}
@@ -99,8 +103,10 @@ class ErrorReporter {
99
103
// / a banner.
100
104
// / TODO: Allow redirection into a file stream.
101
105
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) {
104
110
print (BoldRed, " %s" , ErrorBanner);
105
111
print (BoldRed, Format, Args...);
106
112
print (" \n " );
0 commit comments