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

Compiler error on goto around initialization of trivial objects

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Medium 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

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

              Created:
              Updated:
              Resolved: