Repository navigation
Internal error in find_local_static_variable_init in strict C++03 mode
#233
thinkoid
started this conversation in
Issue Triage - Compilation
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Issue Summary
cpfe fails an assertion on a small, valid C++03 program under
-A. g++ and clang++ accept it with-std=c++98 -pedantic.Reproducing Source Code
Command-line Options
cpfe -A t.cpp
Type of Issue
[Front End] This code SHOULD compile with these options.
Additional Details
It also crashes under
-a. It compiles with-A --no_export,--export, no options, and--c++11 -A.linux-gcc-debugdoes not reproduce it. Seen at e24bb9a.Probable cause: with
exportenabled, lowering offwaits for a module id (must_wait_for_module_id), soset_block_scope_parentsruns before lowering. Lowering then adds a block scope for the return-value temporary (add_temporary_to_scope,lower_il.c:1651) and never sets itsparent. The C back end looks upa's initializer from that block and cannot reachf's scope. Debug builds add checking pragmas to function scopes, soadd_temporary_to_scopeadds no block there.Testing of the patch below: the six option sets on the
linux-gcc-release,linux-gcc-debuggable-releaseandlinux-gcc-debugpresets; 15 variants of the reproducer and the original 19,000-line source; a run-time variant whose output matches g++;edgy --no-flakey-tests allat f0e30b6 (samelower_il.c), with logs identical to an unpatched run.Reproducing (Standard) Configuration(s)
linux-gcc-release, linux-gcc-debuggable-release
Reproducing (Non-standard) Configuration
No response
I acknowledge that:
LICENSE.txtfile in my.zipor.tar.gzupload. If I included aLICENSE.txtfile, any tests created using the reproducing source code will be governed by the terms of the license I provided instead.All reactions