From a8ac25e1ef15201a2bd48d880b90edffe5156727 Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Thu, 14 Feb 2019 14:35:27 -0800 Subject: [PATCH] fix(library/compiler/emit_cpp): bug at emitting exported function headers --- src/library/compiler/emit_cpp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/library/compiler/emit_cpp.cpp b/src/library/compiler/emit_cpp.cpp index e3b9776b41..1231d24411 100644 --- a/src/library/compiler/emit_cpp.cpp +++ b/src/library/compiler/emit_cpp.cpp @@ -52,12 +52,12 @@ static void open_namespaces(std::ostream & out, name const & n) { open_namespaces_core(out, n.get_prefix()); } -/* If `n` has the attribute [cppname], and the "cppname" is hierarchical, then +/* If `n` has the attribute [export], and the "export" is hierarchical, then we must put `n` code inside of a namespace. */ static void open_namespaces_for(std::ostream & out, environment const & env, name const & n) { optional c = get_export_name_for(env, n); if (!c || c->is_atomic()) return; - open_namespaces(out, n); + open_namespaces(out, *c); } static void close_namespaces(std::ostream & out, name const & n) {