Constant initialiation may take place before dynamic initialization

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Medium
    • Code Generation Tools
    • CODEGEN-3993
    • 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
      In the following code, the rvalue reference 'br' will be initialized after the variable 'a', even though 'br' is constant initialized and 'a' is dynamically initialized. This ordering is required by C++14 Section 3.6.2 paragraph 2.

      extern int a;
      extern int f();

      int a = f();

      int&& br = 5;
      int f() { return br; }
       
      int main() {
        if (a != 5) return 1;
        return 0;
      }
      Show
      In the following code, the rvalue reference 'br' will be initialized after the variable 'a', even though 'br' is constant initialized and 'a' is dynamically initialized. This ordering is required by C++14 Section 3.6.2 paragraph 2. extern int a; extern int f(); int a = f(); int&& br = 5; int f() { return br; }   int main() {   if (a != 5) return 1;   return 0; }

      Constant initialiation may take place before dynamic initialization

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

              Created:
              Updated:

                Connection: Intermediate to External PROD System
                EXTSYNC-1061 - Constant initialiation may take pla...
                SYNCHRONIZED
                • Last Sync Date: