Skip to content
Snippets Groups Projects
Commit f5ae4dd6 authored by Andy Gibbs's avatar Andy Gibbs
Browse files

Keep the parentheses in #pragma message (partial revert of r179771).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179862 91177308-0d34-0410-b5e6-96231b3b80d8
parent e6e68b53
No related branches found
No related tags found
No related merge requests found
......@@ -419,7 +419,7 @@ void PrintPPOutputPPCallbacks::PragmaMessage(SourceLocation Loc,
OS << Namespace << ' ';
switch (Kind) {
case PMK_Message:
OS << "message \"";
OS << "message(\"";
break;
case PMK_Warning:
OS << "warning \"";
......@@ -440,6 +440,8 @@ void PrintPPOutputPPCallbacks::PragmaMessage(SourceLocation Loc,
<< (char)('0'+ ((Char >> 0) & 7));
}
OS << '"';
if (Kind == PMK_Message)
OS << ')';
setEmittedDirectiveOnThisLine();
}
......
// RUN: %clang_cc1 -E -Werror -verify %s 2>&1 | FileCheck %s
#pragma message "\\test" // expected-warning {{\test}}
// CHECK: #pragma message "\134test"
// CHECK: #pragma message("\134test")
#pragma message("\\test") // expected-warning {{\test}}
// CHECK: #pragma message "\134test"
// CHECK: #pragma message("\134test")
#pragma GCC warning "\"" "te" "st" "\"" // expected-warning {{"test"}}
// CHECK: #pragma GCC warning "\042test\042"
......
......@@ -32,6 +32,6 @@ B(foo)
// CHECK: #pragma comment(lib, "libfoo")
// CHECK: #pragma clang diagnostic ignored "-Wunused"
// CHECK: #pragma clang diagnostic error "-Wunused"
// CHECK: #pragma message "\042Hello\042, world!"
// CHECK: #pragma message("\042Hello\042, world!")
// CHECK: 0;
int n = pragma_L pragma_u8 pragma_u pragma_U pragma_R pragma_UR pragma_hello 0;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment