Skip to content

Commit e56ffd9

Browse files
authored
Add new "Missing closing brace" example in C2601 error reference
1 parent 684eae2 commit e56ffd9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/error-messages/compiler-errors-2/compiler-error-c2601.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,16 @@ int main()
3737
int two = increment(1);
3838
}
3939
```
40+
41+
## Missing closing brace
42+
43+
If a preceding function is missing a closing brace, the subsequent function is taken to be a local function:
44+
45+
```cpp
46+
// C2601b.cpp
47+
void func()
48+
{
49+
// missing '}' brace here
50+
51+
int main() {} // C2601
52+
```

0 commit comments

Comments
 (0)