Bug ID: 34094
           Summary: Artificial errors due to parser guessing
           Product: clang
           Version: 4.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend

The frontend makes guesses at input errors, such as at missing declarations :

int my_scalars[100];

int foo(int x)
  my_scalar = 1;

// here we forgot to declare my_scalar as a plain int. First, the compiler
correctly emits :
error: use of undeclared 'my_scalar'; did you mean 'my_scalars' ?

But then the parser appears to actually insert the assumed array into the code,
and issues a false subsequent error that is misleading :

error: array type 'int [100]' is not assignable

I have seen more examples, where the 'guess' is actually used.

You are receiving this mail because:
You are on the CC list for the bug.
llvm-bugs mailing list

Reply via email to