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

Global constexpr class errors out when assigning to member data

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • Code Generation Tools
    • CODEGEN-5486
    • Hide
      ARM_18.1.0.LTS
      MSP430_18.1.0.LTS
      C6000_8.3.0
      ARM_18.12.0.LTS
      ARM_19.6.0.STS
      MSP430_18.12.0.LTS
      MSP430_19.6.0.STS
      Show
      ARM_18.1.0.LTS MSP430_18.1.0.LTS C6000_8.3.0 ARM_18.12.0.LTS ARM_19.6.0.STS MSP430_18.12.0.LTS MSP430_19.6.0.STS
    • Hide
      MSP430_18.12.2.LTS
      ARM_18.1.6.LTS
      MSP430_18.1.6.LTS
      ARM_19.6.0.STS
      ARM_18.12.2.LTS
      C6000_8.3.4
      MSP430_19.6.0.STS
      Show
      MSP430_18.12.2.LTS ARM_18.1.6.LTS MSP430_18.1.6.LTS ARM_19.6.0.STS ARM_18.12.2.LTS C6000_8.3.4 MSP430_19.6.0.STS
    • Hide
      The error can be avoided If the constexpr class definition is wrapped in a function which simply returns the instance of the class.

      For example:
      constexpr MyClass getA()
      { MyClass A("This is a constant literal"); return A;}

      Using 'getA()' instead of 'A' will work as expected.
      Show
      The error can be avoided If the constexpr class definition is wrapped in a function which simply returns the instance of the class. For example: constexpr MyClass getA() { MyClass A("This is a constant literal"); return A;} Using 'getA()' instead of 'A' will work as expected.
    • Constexpr class definitions may generate spurious parser errors, including one about "accessing expired storage."

      Global constexpr class errors out when assigning to member data

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

              Created:
              Updated:
              Resolved: