[LLVMbugs] [Bug 10866] template static const is not always initialized

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Sep 5 17:31:32 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=10866

Nick Lewycky <nicholas at mxc.ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |nicholas at mxc.ca
         Resolution|                            |INVALID

--- Comment #1 from Nick Lewycky <nicholas at mxc.ca> 2011-09-05 19:31:31 CDT ---
If I'm not mistaken, your testcase boils down to:

static const int test1 = bar();
static const double test2 = test1 * 0.5;

What's the guarantee that either of those is evaluated first? I realize that
reordering them doesn't make the bug go away, but as I just said, there's no
guarantee that it would.

Further, I just tried it with G++ 4.6.1 on my machine:
$ g++ example.cpp -o example
$ ./example
inf

I'm going to close this bug as invalid. If you think I'm mistaken, please
reopen it!

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list