[cfe-dev] error: use of undeclared label

Douglas Gregor dgregor at apple.com
Fri Feb 19 11:00:55 PST 2010


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



More information about the cfe-dev mailing list