Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!CS.WISC.EDU!bothner From: bothner@CS.WISC.EDU Newsgroups: gnu.g++.bug Subject: Non-constant static sinitializer of struct Message-ID: <9002262211.AA25445@sevenlayer.cs.wisc.edu> Date: 26 Feb 90 22:10:59 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 21 The following doesn't work. It would seem to me it should. G++ correctly compiles I and S3, but gives error messages for S2 and S3. No code is emitted to initialize S2 or S3. (I have g++-1.36.4, based on gcc-1.37.1, for the DECstation-3100, with some additional patches that are unlikely to be the cause of the problem.) --Per Bothner bothner@cs.wisc.edu Computer Science Dept, U. of Wisconsin-Madison int F(int i) { return i + 10; } struct ab { int a; int b;}; int I = F(4); ab S1 = (struct ab){3, F(5)}; ab S2 = {3, F(6)}; ab S3 = {3, 7};