From edf9e7080880f3b3caca1dbdb46493b238cf5c88 Mon Sep 17 00:00:00 2001 From: Austin Henriksen Date: Tue, 3 Dec 2024 20:02:01 -0500 Subject: [PATCH] Forgot to exclude the ruby changes. --- cpp/src/Slice/Parser.cpp | 36 ++++++------------- .../errorDetection/InterfaceMismatch.err | 4 +-- 2 files changed, 12 insertions(+), 28 deletions(-) diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp index 135f54181b7..f21f5c469c7 100644 --- a/cpp/src/Slice/Parser.cpp +++ b/cpp/src/Slice/Parser.cpp @@ -1178,23 +1178,15 @@ Slice::Container::createClassDef(const string& name, int id, const ClassDefPtr& } ClassDefPtr def = make_shared(shared_from_this(), name, id, base); - _unit->addContent(def); - _contents.push_back(def); - - for (const auto& q : matches) - { - ClassDeclPtr decl = dynamic_pointer_cast(q); - decl->_definition = def; - } - // - // Implicitly create a class declaration for each class - // definition. This way the code generator can rely on always - // having a class declaration available for lookup. - // + // Implicitly create a class declaration for each class definition. + // This way the code generator can rely on always having a class declaration available for lookup. ClassDeclPtr decl = createClassDecl(name); def->_declaration = decl; + decl->_definition = def; + _unit->addContent(def); + _contents.push_back(def); return def; } @@ -1330,23 +1322,15 @@ Slice::Container::createInterfaceDef(const string& name, const InterfaceList& ba InterfaceDecl::checkBasesAreLegal(name, bases, _unit); InterfaceDefPtr def = make_shared(shared_from_this(), name, bases); - _unit->addContent(def); - _contents.push_back(def); - - for (const auto& q : matches) - { - InterfaceDeclPtr decl = dynamic_pointer_cast(q); - decl->_definition = def; - } - // - // Implicitly create an interface declaration for each interface - // definition. This way the code generator can rely on always - // having an interface declaration available for lookup. - // + // Implicitly create an interface declaration for each interface definition. + // This way the code generator can rely on always having an interface declaration available for lookup. InterfaceDeclPtr decl = createInterfaceDecl(name); def->_declaration = decl; + decl->_definition = def; + _unit->addContent(def); + _contents.push_back(def); return def; } diff --git a/cpp/test/Slice/errorDetection/InterfaceMismatch.err b/cpp/test/Slice/errorDetection/InterfaceMismatch.err index 66f42a02caf..1c7841afb03 100644 --- a/cpp/test/Slice/errorDetection/InterfaceMismatch.err +++ b/cpp/test/Slice/errorDetection/InterfaceMismatch.err @@ -1,6 +1,6 @@ InterfaceMismatch.ice:9: class `Foo1' was previously declared as an interface InterfaceMismatch.ice:10: class `Foo1' was previously declared as an interface -InterfaceMismatch.ice:13: class `Foo2' was previously defined as an interface +InterfaceMismatch.ice:13: class `Foo2' was previously declared as an interface InterfaceMismatch.ice:16: interface `Foo3' was previously declared as a class InterfaceMismatch.ice:17: interface `Foo3' was previously declared as a class -InterfaceMismatch.ice:20: interface `Foo4' was previously defined as a class +InterfaceMismatch.ice:20: interface `Foo4' was previously declared as a class