[cfe-dev] Spurious error

Sebastian Redl sebastian.redl at getdesigned.at
Fri May 27 06:49:55 PDT 2011


On 27.05.2011 13:08, Csaba Raduly wrote:
> Hi all,
>
> clang++ version 3.0 (trunk 132119)
> Target: x86_64-unknown-linux-gnu
> Thread model: posix
>
> emits an error for the following code:
>
> void puts(const char*);
>
> struct X {};
>
> void exx(X) {}
>
> int main(int argc, char **argv)
> {
>    if (argc>  3)
>      goto end;
>
>    X x;
>    exx(x);
>
>    end:
>      if (argc>  1) {
>      for (int i = 0; i<  argc; ++i)
>      {
>        puts(argv[i]);
>      }
>      }
>      return 0;
> }
>
> c.cc:10:5: error: goto into protected scope
>      goto end;
>      ^
> c.cc:12:5: note: jump bypasses variable initialization
>    X x;
>      ^
Please file a bug at http://llvm.org/bugs

Sebastian



More information about the cfe-dev mailing list