Files
ViewDesignEngine/docs/feedback/VDE-016.md
T
茂之钳 477d13dc80
Build & Test / build-and-test (push) Waiting to run
Build & Test / python-bindings (push) Blocked by required conditions
CI / Build & Test (push) Failing after 34s
CI / Release Build (push) Failing after 25s
fix(v1.0.1): VDE-016 — using declarations at vde::brep scope, not inside anonymous ns
Root cause: using declarations inside anonymous namespace don't propagate
to public functions defined after the anonymous namespace closes.

Fix:
- using SSICurveData; and using ClassResult; at vde::brep scope
- Remove self-referencing using vde::brep::ClassResult
- Remove duplicate using from inside anonymous namespace
2026-07-28 07:48:28 +08:00

2.2 KiB
Raw Blame History

id, status, severity, category, date, updated, reporter, related
id status severity category date updated reporter related
VDE-016 fixed critical bug 2026-07-27 2026-07-27 ViewDesign VDE-001, VDE-005, VDE-010

VDE-016: ssi_boolean.cpp 名称解析 — using 声明位置错误

问题描述

v1.0.4 在匿名 namespace 内部line 57)添加了 using vde::brep::SSICurveData;,但这些 using 声明仅在匿名 namespace 内部有效。匿名 namespace 关闭后,后续的公共函数(line 509+)仍然找不到 SSICurveDataClassResult

编译错误 (v1.0.4)

error: 'SSICurveData' was not declared in this scope
       at line 512 (compute_all_ssi return type)
error: 'ClassResult' was not declared in this scope
       at line 646 (classify_points return type)
error: 'begin'/'end' was not declared in this scope  (级联失败)

根因

// ssi_boolean.cpp 当前结构
namespace vde::brep {                    // line 34
    struct SSICurveData;                  // line 43
    using vde::brep::ClassResult;         // line 44 — 自引用,无效
    struct SSICurveData { ... };          // line 47

    namespace {                           // line 56
        using vde::brep::SSICurveData;    // ← 仅在匿名 ns 内有效!
        using vde::brep::ClassResult;     // ← 同上
        ...
    }                                     // line 92 或 432 关闭

    // 以下公共函数在 vde::brep 作用域,using 声明已失效
    std::vector<SSICurveData> compute_all_ssi(...) {  // ← 找不到
    std::vector<...ClassResult> classify_points(...) {  // ← 找不到
}

正确修复

将 using 声明放在 vde::brep 作用域(匿名 namespace 之外):

namespace vde::brep {
    struct SSICurveData;
    using SSICurveData;       // ← 放在这里(vde::brep 级别)
    using ClassResult;        // ← 替代自引用的 using vde::brep::ClassResult;
    struct SSICurveData { ... };

    namespace {
        // 不需要这里的 using 了
        ...
    }

    // 公共函数现在可以找到 SSICurveData 和 ClassResult
    std::vector<SSICurveData> compute_all_ssi(...) { ... }
}

当前 Workaround

ViewDesign 排除 vde_brep 及其依赖。