Compiler error on goto around initialization of trivial objects

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Medium
    • Code Generation Tools
    • CODEGEN-4242
    • 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 syntax error, stating that the 'goto label' bypasses the initialization of the S object, 's'.

      struct S {
       public:
         int i;
       private:
         int j;
      }
      void test() {
         goto label;
         {
           S s;
      label:
           ;
         }
      }

      This is unexpected because the default initialization for an S object is trivial. The standard only requires diagnostics when the initialization is not trivial.
      Show
      The following code emits a syntax error, stating that the 'goto label' bypasses the initialization of the S object, 's'. struct S {  public:    int i;  private:    int j; } void test() {    goto label;    {      S s; label:      ;    } } This is unexpected because the default initialization for an S object is trivial. The standard only requires diagnostics when the initialization is not trivial.
    • CODEGEN-3951

      Compiler error on goto around initialization of trivial objects

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

              Created:
              Updated:
              Resolved:

                Connection: Intermediate to External PROD System
                EXTSYNC-1087 - Compiler error on goto around initi...
                SYNCHRONIZED
                • Last Sync Date: