Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[trunk] ICE in invalid code #17

Closed
NinaRanns opened this issue Nov 6, 2024 · 2 comments
Closed

[trunk] ICE in invalid code #17

NinaRanns opened this issue Nov 6, 2024 · 2 comments

Comments

@NinaRanns
Copy link
Owner

NinaRanns commented Nov 6, 2024

https://godbolt.org/z/xh8q3cWG8

#include <iostream>
inline int f(int& i)
{
   i++;
}
int main()
{
   int i = 3;
   contract_assert(i > 2)
   f(i);
   std::cout << i;
}
<source>: In function 'int f(int&)':
<source>:5:1: warning: no return statement in function returning non-void [-Wreturn-type]
    5 | }
      | ^
<source>: In function 'int main()':
<source>:10:8: internal compiler error: in cp_parser_statement, at cp/parser.cc:13161
   10 |    f(i);
      |        ^
0x2805185 diagnostic_context::diagnostic_impl(rich_location*, diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag (*) [1], diagnostic_t)
	???:0
0x2818865 internal_error(char const*, ...)
	???:0
0xa87ede fancy_abort(char const*, int, char const*)
	???:0
0xc97eca c_parse_file()
	???:0
0xdef269 c_common_parse_file()
	???:0
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1
@NinaRanns
Copy link
Owner Author

reproducible on trunk https://godbolt.org/z/51TnzsfGE

@NinaRanns
Copy link
Owner Author

fixed in natural syntax branch wtih 3da51af
tracked for trunk with https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117579

@NinaRanns NinaRanns changed the title ICE in invalid code [trunk] ICE in invalid code Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant