[Bug c++/79563] Same-name labels in lambdas considered duplicate

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Feb 20 18:47:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79563

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-02-20
                 CC|                            |msebor at gcc dot gnu.org
     Ever confirmed|0                           |1
      Known to fail|                            |4.5.3, 4.8.3, 4.9.3, 5.3.0,
                   |                            |6.2.0, 7.0

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
Confirmed.  GCC never accepted the test case so it's not a regression.

$ cat t.C && gcc -S -Wall -Wextra -Wpedantic t.C
void f() {
        goto exit;
        []() -> void {
                exit: ;
        }();
        exit: ;
}
t.C: In lambda function:
t.C:4:17: warning: label ‘exit’ defined but not used [-Wunused-label]
                 exit: ;
                 ^~~~
t.C: In function ‘void f()’:
t.C:2:14: error: label ‘exit’ used but not defined
         goto exit;
              ^~~~
t.C:7:1: error: duplicate label ‘exit’
 }
 ^
t.C:6:9: warning: label ‘exit’ defined but not used [-Wunused-label]
         exit: ;
         ^~~~


More information about the Gcc-bugs mailing list