Uploaded image for project: 'Embedded Software & Tools'
  1. Embedded Software & Tools
  2. EXT_EP-8570

std::nullptr_t cannot be used to initialize entity of type bool

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Medium Medium
    • Code Generation Tools
    • CODEGEN-3901
    • Hide
      ARM_18.1.0.LTS
       MSP430_18.1.0.LTS
      Show
      ARM_18.1.0.LTS  MSP430_18.1.0.LTS
    • Hide
      The following code emits a diagnostic on the initialization of 'abool'

      #include <cstddef>
      int main() {
        std::nullptr_t pnptr = nullptr;
        bool abool = pnptr; // error, nullptr_t cannot initialize an entity of type bool
        return 0;
      }
      Show
      The following code emits a diagnostic on the initialization of 'abool' #include <cstddef> int main() {   std::nullptr_t pnptr = nullptr;   bool abool = pnptr; // error, nullptr_t cannot initialize an entity of type bool   return 0; }
    • This is ill-formed code. nullptr_t can be implicitly converted to bool only in a direct initialization context. This means that...

      std::nullptr_t cannot be used to initialize entity of type bool

            syncuser TI User
            syncuser TI User
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: