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

David Majnemer <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |INVALID

--- Comment #4 from David Majnemer <[email protected]> ---
The optimizer is still able to prove that it doesn't need to reference the
actual static.

The following is an example that will have a linker error under all levels of
optimizations:
template <class T>
struct foo {
  static int alloc;
};

int main() {
  return foo<int>::alloc;
}

Note that this program, and all of the programs you have posted, have undefined
behavior because they don't provide a definition of the static variable.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to