|
| 1 | +<HTML> |
| 2 | +<HEAD> |
| 3 | +<meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> |
| 4 | +<TITLE> |
| 5 | + CWG Issue 2908</TITLE> |
| 6 | +<STYLE TYPE="text/css"> |
| 7 | + INS { text-decoration:none; font-weight:bold; background-color:#A0FFA0 } |
| 8 | + .INS { text-decoration:none; background-color:#D0FFD0 } |
| 9 | + DEL { text-decoration:line-through; background-color:#FFA0A0 } |
| 10 | + .DEL { text-decoration:line-through; background-color: #FFD0D0 } |
| 11 | + SPAN.cmnt { font-family:Times; font-style:italic } |
| 12 | +</STYLE> |
| 13 | +</HEAD> |
| 14 | +<BODY> |
| 15 | +<P><EM>This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 |
| 16 | + Core Issues List revision 114b. |
| 17 | + See http://www.open-std.org/jtc1/sc22/wg21/ for the official |
| 18 | + list.</EM></P> |
| 19 | +<P>2024-06-24</P> |
| 20 | +<HR> |
| 21 | +<A NAME="2908"></A><H4>2908. |
| 22 | + |
| 23 | +Counting physical source lines for <TT>__LINE__</TT> |
| 24 | +</H4> |
| 25 | +<B>Section: </B>15.7  [<A href="https://wg21.link/cpp.line">cpp.line</A>] |
| 26 | +     |
| 27 | + |
| 28 | + <B>Status: </B>open |
| 29 | +     |
| 30 | + |
| 31 | + <B>Submitter: </B>Alisdair Meredith |
| 32 | +     |
| 33 | + |
| 34 | + <B>Date: </B>2024-06-17<BR> |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | +<P>Given the existing implementation divergence, it should be |
| 40 | +clarified that <TT>__LINE__</TT> counts physical source lines, not |
| 41 | +logical ones.</P> |
| 42 | + |
| 43 | +<P><U>Possible resolution:</U></P> |
| 44 | + |
| 45 | +<P>Change in 15.7 [<A href="https://wg21.link/cpp.line#2">cpp.line</A>] paragraph 2 as follows:</P> |
| 46 | +<BLOCKQUOTE> |
| 47 | + |
| 48 | +The <I>line number</I> of the current source line is <INS>the line |
| 49 | +number of the current physical source line, i.e. it is</INS> one |
| 50 | +greater than the number of new-line characters read or introduced in |
| 51 | +translation phase 1 (5.2 [<A href="https://wg21.link/lex.phases">lex.phases</A>]) while processing the |
| 52 | +source file to the current token. |
| 53 | + |
| 54 | +</BLOCKQUOTE> |
| 55 | +<BR><BR> |
| 56 | +</BODY> |
| 57 | +</HTML> |
0 commit comments