Bugzilla – Bug 152
[llvm-g++] Pointer to member initializers not supported in constructors
Last modified: 2003-11-25 18:31:58
You need to log in before you can comment on or make changes to this bug.
The llvm-g++ program crashes with the following assertion: cc1plus: ../../gcc-3.4/gcc/llvm-expand.c:3198: llvm_expand_constructor_element: Assertion `((enum tree_code) (value)->common.code) == CONSTRUCTOR || ((enum tree_code) (value)->common.code) == STRING_CST' failed. /home/vadve/criswell/assert.cpp: In function `int evaluateCentralControl()': /home/vadve/criswell/assert.cpp:61: internal compiler error: Aborted The offending file will be attached.
Created an attachment (id=38) [details] Program that triggers the assertion. This file comes from junfa-0.0.2 (source file Evaluator.cpp and it's associated header files).
Fixed. Here's the patch: ]$ diff -u llvm-expand.c~ llvm-expand.c --- llvm-expand.c~ 2003-11-25 02:38:39.000000000 -0600 +++ llvm-expand.c 2003-11-25 18:19:27.000000000 -0600 @@ -3505,7 +3505,7 @@ /* Store each element of the constructor into the corresponding element of TARGET, determined by counting the elements. */ for (elt = CONSTRUCTOR_ELTS (exp); elt; elt = TREE_CHAIN (elt)) { - tree value = TREE_VALUE (elt); + tree value = lang_hooks.expand_constant(TREE_VALUE(elt)); tree index = TREE_PURPOSE (elt); if (index && TREE_CODE(index) == RANGE_EXPR) { I didn't check in a testcase, because I was able to fix this without reducing the program. -Chris