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

Invalid conversion on static_cast from T1 to rvalue reference of T2

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • Code Generation Tools
    • CODEGEN-3965
    • Hide
      ARM_18.1.0.LTS
      MSP430_18.1.0.LTS
      MSP430_20.2.0.LTS
      ARM_18.12.0.LTS
      MSP430_21.6.0.LTS
      MSP430_18.12.0.LTS
      ARM_20.2.0.LTS
      Show
      ARM_18.1.0.LTS MSP430_18.1.0.LTS MSP430_20.2.0.LTS ARM_18.12.0.LTS MSP430_21.6.0.LTS MSP430_18.12.0.LTS ARM_20.2.0.LTS
    • Hide
      The following code results in a syntax error, while it is accepted by both gcc and clang.

      int main()
      {
          char c = 1;
          const int &&r = static_cast<const int&&>(c);
          return r;
      }

      As a workaround, 'c' may be cast to int. However, doing so will not bind reference r to the variable c.
      Show
      The following code results in a syntax error, while it is accepted by both gcc and clang. int main() {     char c = 1;     const int &&r = static_cast<const int&&>(c);     return r; } As a workaround, 'c' may be cast to int. However, doing so will not bind reference r to the variable c.

      Invalid conversion on static_cast from T1 to rvalue reference of T2

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

              Created:
              Updated: