Skip to content

Commit 9ca2f45

Browse files
committed
2 parents de27e96 + dc0ae62 commit 9ca2f45

6 files changed

+27
-2
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
x: i32 = 0; // ugh
2+
int main() { }

regression-tests/test-results/clang-18/mixed-bugfix-for-cpp2-comment-cpp1-sequence.cpp.execution

Whitespace-only changes.

regression-tests/test-results/clang-18/mixed-bugfix-for-cpp2-comment-cpp1-sequence.cpp.output

Whitespace-only changes.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
3+
//=== Cpp2 type declarations ====================================================
4+
5+
6+
#include "cpp2util.h"
7+
8+
9+
10+
//=== Cpp2 type definitions and function declarations ===========================
11+
12+
#line 1 "mixed-bugfix-for-cpp2-comment-cpp1-sequence.cpp2"
13+
extern cpp2::i32 x;
14+
int main() { }
15+
// ugh
16+
17+
//=== Cpp2 function definitions =================================================
18+
19+
#line 1 "mixed-bugfix-for-cpp2-comment-cpp1-sequence.cpp2"
20+
cpp2::i32 x {0};
21+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
mixed-bugfix-for-cpp2-comment-cpp1-sequence.cpp2... ok (mixed Cpp1/Cpp2, Cpp2 code passes safety checks)
2+

source/io.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ auto process_cpp_line(
623623
}
624624
}
625625
}
626-
626+
627627
break;case '\"':
628628
// If this isn't an escaped quote, toggle string literal state
629629
if (
@@ -746,7 +746,7 @@ auto process_cpp2_line(
746746
}
747747

748748
break;case '/':
749-
if (prev == '/') { in_comment = false; return false; }
749+
if (prev == '/') { in_comment = false; return found_end; }
750750

751751
break;case '"':
752752
if (prev != '\\') { in_string_literal = true; }

0 commit comments

Comments
 (0)