[Bug c/111758] #pragma region/endregion fails between if/else

2023-10-10 Thread domen.stangar at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111758

--- Comment #2 from Domen Stangar  ---
I don't agree. This works fine with 12.x version and bug report is for version
4.9.1.
And this compiles with 4.9.1 version.

[Bug c/111758] New: #pragma region/endregion fails between if/else

2023-10-10 Thread domen.stangar at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111758

Bug ID: 111758
   Summary: #pragma region/endregion fails between if/else
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: domen.stangar at gmail dot com
  Target Milestone: ---

#include 
int main() {
#pragma region test
if(1){}
#pragma endregion
else{}
}

gcc 13.x fails with output

: In function 'main':
:7:5: error: 'else' without a previous 'if'
7 | else
  | ^~~~
Compiler returned: 1

while 12.x works fine.