Patchwork [trans-mem] Avoid ICE with transaction expressions vs constant expressions.

login
register
mail settings
Submitter Richard Henderson
Date Nov. 5, 2011, 1:47 a.m.
Message ID <4EB4959D.1000502@redhat.com>
Download mbox | patch
Permalink /patch/123726/
State New
Headers show

Comments

Richard Henderson - Nov. 5, 2011, 1:47 a.m.
On 11/04/2011 05:54 PM, Paolo Carlini wrote:
> ... isn't translated correctly. Maybe better wrapping the strings in G_().

Ah, right.  Fixed here, and the place I copied it from.


r~

Patch

diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 7a7cfe8..b6ac918 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -26665,10 +26665,10 @@  cp_parser_transaction_expression (cp_parser *parser, enum rid keyword)
 
   if (!flag_tm)
     error (keyword == RID_TRANSACTION_RELAXED
-	   ? "%<__transaction_relaxed%> without transactional memory "
-             "support enabled"
-	   : "%<__transaction_atomic%> without transactional memory "
-             "support enabled");
+	   ? G_("%<__transaction_relaxed%> without transactional memory "
+                "support enabled")
+	   : G_("%<__transaction_atomic%> without transactional memory "
+                "support enabled"));
 
   token = cp_parser_require_keyword (parser, keyword,
       (keyword == RID_TRANSACTION_ATOMIC ? RT_TRANSACTION_ATOMIC
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index e75589e..d1967ee 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -4983,11 +4983,11 @@  begin_transaction_stmt (location_t loc, tree *pcompound, int flags)
   if (flag_tm)
     add_stmt (r);
   else
-    error_at (loc, ((flags & TM_STMT_ATTR_RELAXED) != 0 ?
-        "%<__transaction_relaxed%> without transactional memory "
-	      "support enabled"
-        : "%<__transaction_atomic%> without transactional memory "
-	      "support enabled"));
+    error_at (loc, ((flags & TM_STMT_ATTR_RELAXED) != 0
+		    ? G_("%<__transaction_relaxed%> without "
+			 "transactional memory support enabled")
+		    : G_("%<__transaction_atomic%> without "
+			 "transactional memory support enabled")));
 
   TRANSACTION_EXPR_BODY (r) = push_stmt_list ();
   return r;