Bug 1415500 - internal compiler error: in tsubst_decl, at cp/pt.c:11747
Summary: internal compiler error: in tsubst_decl, at cp/pt.c:11747
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 25
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-22 17:18 UTC by Jason Kankiewicz
Modified: 2017-12-12 10:48 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-12-12 10:48:02 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Preprocessed source file (2.66 MB, text/x-csrc)
2017-01-22 17:18 UTC, Jason Kankiewicz
no flags Details

Description Jason Kankiewicz 2017-01-22 17:18:39 UTC
Created attachment 1243373 [details]
Preprocessed source file

Description of problem:
Internal compiler error when attempting to build a unit test within an example C++14 project.

Version-Release number of selected component (if applicable):
6.3.1

How reproducible:
Clone the original git repository, patch the source files to eliminate the erroneous use of C99 designated initializers, generate the makefile and build everything.

Steps to Reproduce:
1. git clone --recursive https://github.com/modern-cpp-examples/match3.git
2. cd match3
3. cp ../match3.git.patch .
4. git apply match3.git.patch
4. cmake .
5. make all

Actual results:
...
[ 39%] Building CXX object test/CMakeFiles/test.unit_tests_controller_actions_generate_new.dir/unit_tests/controller/actions/generate_new.cpp.o
/tmp/match3/test/unit_tests/controller/actions/generate_new.cpp: In instantiation of ‘main()::<lambda()>::<lambda(auto:28, ...)> [with auto:28 = int]’:
/usr/include/c++/6.3.1/type_traits:2481:26:   required by substitution of ‘template<class _Fn, class ... _Args> static std::__result_of_success<decltype (declval<_Fn>()((declval<_Args>)()...)), std::__invoke_other> std::__result_of_other_impl::_S_test(int) [with _Fn = main()::<lambda()>::<lambda(auto:28, ...)>&; _Args = {int, int}]’
/usr/include/c++/6.3.1/type_traits:2492:55:   required from ‘struct std::__result_of_impl<false, false, main()::<lambda()>::<lambda(auto:28, ...)>&, int, int>’
/usr/include/c++/6.3.1/type_traits:2496:12:   required from ‘class std::result_of<main()::<lambda()>::<lambda(auto:28, ...)>&(int, int)>’
/usr/include/c++/6.3.1/functional:1913:9:   required by substitution of ‘template<class _Functor, class, class> std::function<_Res(_ArgTypes ...)>::function(_Functor) [with _Functor = main()::<lambda()>::<lambda(auto:28, ...)>; <template-parameter-1-2> = void; <template-parameter-1-3> = <missing>]’
/tmp/match3/test/unit_tests/controller/actions/generate_new.cpp:24:45:   required from here
/tmp/match3/test/unit_tests/controller/actions/generate_new.cpp:16:26: internal compiler error: in tsubst_decl, at cp/pt.c:11747
   "generate new"_test = [] {
                          ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccGO2i5S.out file, please attach this to your bugreport.
test/CMakeFiles/test.unit_tests_controller_actions_generate_new.dir/build.make:62: recipe for target 'test/CMakeFiles/test.unit_tests_controller_actions_generate_new.dir/unit_tests/controller/actions/generate_new.cpp.o' failed
make[2]: *** [test/CMakeFiles/test.unit_tests_controller_actions_generate_new.dir/unit_tests/controller/actions/generate_new.cpp.o] Error 1
CMakeFiles/Makefile2:396: recipe for target 'test/CMakeFiles/test.unit_tests_controller_actions_generate_new.dir/all' failed
make[1]: *** [test/CMakeFiles/test.unit_tests_controller_actions_generate_new.dir/all] Error 2
Makefile:94: recipe for target 'all' failed
make: *** [all] Error 2

Expected results:
...
[ 39%] Building CXX object test/CMakeFiles/test.unit_tests_controller_actions_generate_new.dir/unit_tests/controller/actions/generate_new.cpp.o
[ 43%] Linking CXX executable test.unit_tests_controller_actions_generate_new
[ 43%] Built target test.unit_tests_controller_actions_generate_new
...

Additional info:
cat match3.git.patch
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 08298d4..26192ef 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,10 +28,10 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
+#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic-errors")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c99-extensions")
+#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic-errors")
+#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c99-extensions")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include pph.hpp")
 
 if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Emscripten")
diff --git a/test/unit_tests/controller/actions/destroy_matches.cpp b/test/unit_tests/controller/actions/destroy_matches.cpp
index bb99bfd..d99bdb8 100644
--- a/test/unit_tests/controller/actions/destroy_matches.cpp
+++ b/test/unit_tests/controller/actions/destroy_matches.cpp
@@ -18,7 +18,7 @@ int main() {
     constexpr auto height = 3;
 
     board b{{4, 2, 3, 3, 2, 2, 1, 2, 3},
-            config{.board_width = width, .board_height = height}};
+            config{"", 0, 0, width, height, 0, 0}};
     struct {
       std::vector<board::color_t> matches;
     } event{{1, 4, 7}};
diff --git a/test/unit_tests/controller/actions/find_matches.cpp b/test/unit_tests/controller/actions/find_matches.cpp
index 17f94fc..42d78c5 100644
--- a/test/unit_tests/controller/actions/find_matches.cpp
+++ b/test/unit_tests/controller/actions/find_matches.cpp
@@ -13,7 +13,7 @@
 int main() {
   using namespace match3;
   "find matches empty"_test = [] {
-    board b{{1, 2, 3, 4}, config{.board_width = 2}};
+    board b{{1, 2, 3, 4}, config{"", 0, 0, 2, 0, 0, 0}};
     selected s = {0, 1};
     struct {
       int arity;
@@ -27,7 +27,7 @@ int main() {
   };
 
   "find matches"_test = [] {
-    board b{{1, 2, 3, 1, 3, 2, 1, 2, 3}, config{.board_width = 3}};
+    board b{{1, 2, 3, 1, 3, 2, 1, 2, 3}, config{"", 0, 0, 3, 0, 0, 0}};
     selected s = {0};
     struct {
       int arity;
@@ -41,7 +41,7 @@ int main() {
   };
 
   "find matches more"_test = [] {
-    board b{{1, 2, 3, 1, 1, 1, 1, 2, 3}, config{.board_width = 3}};
+    board b{{1, 2, 3, 1, 1, 1, 1, 2, 3}, config{"", 0, 0, 3, 0, 0, 0}};
     selected s = {1, 3};
     struct {
       int arity;
diff --git a/test/unit_tests/controller/actions/generate_new.cpp b/test/unit_tests/controller/actions/generate_new.cpp
index 980b07c..624ea52 100644
--- a/test/unit_tests/controller/actions/generate_new.cpp
+++ b/test/unit_tests/controller/actions/generate_new.cpp
@@ -18,9 +18,9 @@ int main() {
     constexpr auto width = 3;
     constexpr auto height = 3;
     board b{{4, 0, 3, 3, 0, 2, 1, 0, 3},
-            config{.board_width = width, .board_height = height}};
+            config{"", 0, 0, width, height, 0, 0}};
     selected s = {0, 5};
-    generate_new(b, s, config{.board_width = width, .board_height = height},
+    generate_new(b, s, config{"", 0, 0, width, height, 0, 0},
                  [](auto...) { return NEW; });
 
     expect(equal<width * height>({4, NEW, 3, 3, NEW, 2, 1, NEW, 3}, b));

Comment 1 Jason Kankiewicz 2017-01-22 19:04:17 UTC
Removing the "static" qualifier from the "static constexpr auto NEW = 42;" declaration e.g. "constexpr auto NEW = 42;" avoids the internal compiler error.

Comment 2 Fedora End Of Life 2017-11-16 19:19:26 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '25'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 25 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 3 Fedora End Of Life 2017-12-12 10:48:02 UTC
Fedora 25 changed to end-of-life (EOL) status on 2017-12-12. Fedora 25 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.