error: use of undeclared label

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

error: use of undeclared label

Rene Rebe
Hi all,

I reduced another real-world source code currently erroring out with clang++ svn:HEAD. As far as I can see it is triggered by crossing class definition with ctor - reduced code fragment:

int foo()
{
 goto error;
 {
   struct BitPacker {
   BitPacker() {}
   };
   BitPacker packer;
 }

 error:
 return -1;
}

While G++ accepts it, clang++ errors out with:

test.cc:3:7: error: use of undeclared label 'error'
 goto error;
      ^
1 diagnostic generated.

Removing the ctor is enough to make it compile.

I have not found something similar in bugzilla. Thoughts?

René
--
  René Rebe, ExactCODE GmbH, Jaegerstr. 67, DE-10117 Berlin
  http://exactcode.com | http://t2-project.org | http://rene.rebe.name


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: error: use of undeclared label

Douglas Gregor

On Feb 19, 2010, at 5:22 AM, Rene Rebe wrote:

> Hi all,
>
> I reduced another real-world source code currently erroring out with clang++ svn:HEAD. As far as I can see it is triggered by crossing class definition with ctor - reduced code fragment:
>
> int foo()
> {
> goto error;
> {
>   struct BitPacker {
>   BitPacker() {}
>   };
>   BitPacker packer;
> }
>
> error:
> return -1;
> }
>
> While G++ accepts it, clang++ errors out with:
>
> test.cc:3:7: error: use of undeclared label 'error'
> goto error;
>      ^
> 1 diagnostic generated.
>
> Removing the ctor is enough to make it compile.
>
> I have not found something similar in bugzilla. Thoughts?

Strange, but definitely a bug. Please file a Bugzilla!

        - Doug
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: error: use of undeclared label

Rene Rebe
On 19.02.2010, at 20:00, Douglas Gregor wrote:

> On Feb 19, 2010, at 5:22 AM, Rene Rebe wrote:
>
>> Hi all,
>>
>> I reduced another real-world source code currently erroring out with clang++ svn:HEAD. As far as I can see it is triggered by crossing class definition with ctor - reduced code fragment:
>>
>> int foo()
>> {
>> goto error;
>> {
>>  struct BitPacker {
>>  BitPacker() {}
>>  };
>>  BitPacker packer;
>> }
>>
>> error:
>> return -1;
>> }
>>
>> While G++ accepts it, clang++ errors out with:
>>
>> test.cc:3:7: error: use of undeclared label 'error'
>> goto error;
>>     ^
>> 1 diagnostic generated.
>>
>> Removing the ctor is enough to make it compile.
>>
>> I have not found something similar in bugzilla. Thoughts?
>
> Strange, but definitely a bug. Please file a Bugzilla!
>
> - Doug


http://llvm.org/bugs/show_bug.cgi?id=6382

--
  René Rebe, ExactCODE GmbH, Jaegerstr. 67, DE-10117 Berlin
  http://exactcode.com | http://t2-project.org | http://rene.rebe.name


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev