Summary: Structs with non-const destructors cannot be used as
                    const parameters
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: major
          Priority: P2
         Component: DMD

--- Comment #0 from Don <> 2010-06-17 00:03:49 PDT ---
struct A {
    ~this() {}

void foo(const A a) {}
bug.d(4): Error: destructor bug.A.~this () is not callable using argument types

Workaround is to change ~this() into const ~this().

I find this whole situation pretty weird.  How can a destructor be const? (Is a
const struct effectively 'tail const', so that a const destructor only destroys
the non-const bit?) 
And anyway, should a destructor be called on non-mutable function parameters?
In any case, the error message is rather poor.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to