Commit Graph

7 Commits

Author SHA1 Message Date
Richard Smith 4297375561 C++11 allows unions to have static data members. Remove the corresponding
restriction and add some tests.

llvm-svn: 150721
2012-02-16 20:41:22 +00:00
Richard Smith 11562c5e10 Reinstate r142844 (reverted in r142872) now that lvalue-to-rvalue conversions
are present in all the necessary places:

In constant expression evaluation, evaluate lvalues as lvalues and rvalues as
rvalues. Remove special case for caching reference initialization and fix a
cyclic initialization crash in the process.

llvm-svn: 143204
2011-10-28 17:51:58 +00:00
John McCall a97f329869 Template static data members can have weak_odr linkage, not just
weak linkage.  Also, fix a problem where global weak variables
with non-trivial initializers were getting guard variables, or at
least were checking for them and then crashing.

llvm-svn: 129342
2011-04-12 01:46:54 +00:00
John McCall cdf7ef5437 Simplify the logic for emitting guard variables for template static
data members by delaying the emission of the initializer until after
linkage and visibility have been set on the global.  Also, don't
emit a guard unless the variable actually ends up with vague linkage,
and don't use thread-safe statics in any case.

llvm-svn: 118336
2010-11-06 09:44:32 +00:00
Anders Carlsson ca4a5459d8 Use the right definition when emitting a global variable. Fixes PR5564.
llvm-svn: 94555
2010-01-26 17:43:42 +00:00
Daniel Dunbar 8fbe78f6fc Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
- This is designed to make it obvious that %clang_cc1 is a "test variable"
   which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
   can be useful to redefine what gets run as 'clang -cc1' (for example, to set
   a default target).

llvm-svn: 91446
2009-12-15 20:14:24 +00:00
Anders Carlsson 8943e2b8a0 Fix a crash when referencing static data members.
llvm-svn: 80835
2009-09-02 21:01:21 +00:00