You can use __LINE__, along with __FILE__, to report where problems occur in the source code.

Consider, for example, the assert() macro - this wording from the C99 standard, but C++ is similar, except it does not mention __func__:


  When it is executed, if expression (which shall have a scalar type) is false (that is,
  compares equal to 0), the assert macro writes information about the particular call that
  failed (including the text of the argument, the name of the source file, the source line
  number, and the name of the enclosing function — the latter are respectively the values of
  the preprocessing macros __FILE__ and __LINE__ and of the identifier
  __func__) on the standard error stream in an implementation-defined format.


#define assert(x) (void)(((x)==0)?_Assert(#x,__FILE__,__LINE__,__func__):0)


Why would you use the __LINE__ macro in C++
John 19:38 - 40 (NLT)


  38 “What is truth?” Pilate asked. Then he went out again to the people
  and told them, “He is not guilty of any crime. 39 But you have a
  custom of asking me to release one prisoner each year at Passover.
  Would you like me to release this ‘King of the Jews’?”
  
  40 But they shouted back, “No! Not this man. We want Barabbas!”
  (Barabbas was a revolutionary.)


Why were they so messed up that they would choose the rebellious, murderous Barabbas over the innocent Son of God?
