From 029e359da92e8a61860c00e1c647d8af6f9f7920 Mon Sep 17 00:00:00 2001
From: Botond Baranyi <botond.baranyi@ericsson.com>
Date: Thu, 11 Mar 2021 17:53:36 +0100
Subject: [PATCH] OOP: fixed nested template argument lists in code generated
 for exceptions (Bug 568899)

Signed-off-by: Botond Baranyi <botond.baranyi@ericsson.com>
Change-Id: I8c35937c31664f821565314e44e5b4ec1f8fa21f
---
 compiler2/ttcn3/AST_ttcn3.cc | 2 +-
 compiler2/ttcn3/Statement.cc | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/compiler2/ttcn3/AST_ttcn3.cc b/compiler2/ttcn3/AST_ttcn3.cc
index 0bbdd6475..a37e008b8 100644
--- a/compiler2/ttcn3/AST_ttcn3.cc
+++ b/compiler2/ttcn3/AST_ttcn3.cc
@@ -5548,7 +5548,7 @@ namespace Ttcn {
   
   char* Def_Exception::generate_code_str(char *str)
   {
-    return mputprintf(str, "EXCEPTION<%s>& %s = static_cast<EXCEPTION<%s>&>(exc_base);\n",
+    return mputprintf(str, "EXCEPTION< %s >& %s = static_cast<EXCEPTION< %s >&>(exc_base);\n",
       type->get_genname_value(my_scope).c_str(), id->get_name().c_str(), type->get_genname_value(my_scope).c_str());
   }
 
diff --git a/compiler2/ttcn3/Statement.cc b/compiler2/ttcn3/Statement.cc
index 8b97d8fd1..b606bc492 100644
--- a/compiler2/ttcn3/Statement.cc
+++ b/compiler2/ttcn3/Statement.cc
@@ -8569,7 +8569,7 @@ error:
       str = mputprintf(str,  "%s[%i] = \"%s\";\n",
         id_str.c_str(), i, t != NULL ? t->get_exception_name().c_str() : "object");
     }
-    str = mputprintf(str, "throw EXCEPTION<%s>(new %s(%s), %s, %i);\n",
+    str = mputprintf(str, "throw EXCEPTION< %s >(new %s(%s), %s, %i);\n",
       exc_type_str.c_str(), exc_type_str.c_str(), expr.expr, id_str.c_str(), nof_exc_types);
     if (expr.postamble != NULL) {
       str = mputstr(str, expr.postamble);
-- 
GitLab