[Issue 20794] New: attempting to instantiate core.stdcpp.vector.vector gives wrong error message

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat May 2 18:24:32 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=20794

          Issue ID: 20794
           Summary: attempting to instantiate core.stdcpp.vector.vector
                    gives wrong error message
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P1
         Component: druntime
          Assignee: nobody at puremagic.com
          Reporter: gregormueckl at gmx.de

The following programm cannot be compiled using dmd 2.091.0 on Linux:

---

import core.stdcpp.vector;

void main()
{
    vector!int cppVector;
}

---

Attempting to compile it results in 

> rdmd vectortest.d 
/usr/include/dlang/dmd/core/stdcpp/vector.d(57): Error: undefined identifier
size, did you mean alias size_t?
vectortest.d(5): Error: template instance core.stdcpp.vector.vector!(int,
allocator!int) error instantiating
Failed: ["/usr/bin/dmd", "-v", "-o-", "vectortest.d", "-I."]

The static assert in line 740 of vector.d is likely intended to fail to give an
informative error message:

---
    else
    {
        static assert(false, "C++ runtime not supported");
    }
---

However, the compiler fails earlier than that, resulting in the cryptic message
quoted above.

--


More information about the Digitalmars-d-bugs mailing list