summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/class/class.union
Commit message (Collapse)AuthorAgeFilesLines
* Add missing diagnostic for anonymous struct/union definitions that don'tRichard Smith2019-04-241-1/+1
| | | | | | introduce any names. llvm-svn: 359051
* Adjust and fix failing CXX tests after r332799Eric Fiselier2018-05-191-8/+8
| | | | llvm-svn: 332800
* Fix all tests under test/CXX (and test/Analysis) to pass if clang's defaultRichard Smith2016-08-311-1/+1
| | | | | | C++ language standard is not C++98. llvm-svn: 280309
* PR26048, PR26050: put non-type template parameters and indirect field declsRichard Smith2016-01-061-4/+2
| | | | | | | | into IDNS_Tag in C++, because they conflict with redeclarations of tags. (This doesn't affect elaborated-type-specifier lookup, which looks for IDNS_Type in C++). llvm-svn: 256985
* Fix half of PR26048. We don't yet diagnose the case where the anonymous ↵Richard Smith2016-01-062-0/+26
| | | | | | union member is declared first and the tag name is declared second. llvm-svn: 256979
* Implement DR1460: fix handling of default initializers in unions; don't allowRichard Smith2013-12-101-0/+10
| | | | | | | | | more than one such initializer in a union, make mem-initializers override default initializers for other union members, handle anonymous unions with anonymous struct members better. Fix a couple of semi-related bugs exposed by the tests for same. llvm-svn: 196892
* Move -Wstatic-float-init fixit into a note & don't recover as if constexprDavid Blaikie2013-01-291-1/+1
| | | | llvm-svn: 173841
* Sync 'in class initialization of static const double' extension up with GCC,Richard Smith2013-01-251-1/+1
| | | | | | | | | | | | | and split it out of -Wgnu into its own warning flag. * In C++11, this is now a hard error (GCC has no extension here in C++11 mode). The error can be disabled with -Wno-static-float-init, and has a fixit to add 'constexpr'. * In C++98, this is still an ExtWarn, but is now controlled by -Wstatic-float-init as well as -Wgnu. llvm-svn: 173414
* Properly compute triviality for explicitly-defaulted or deleted special members.Richard Smith2012-12-081-25/+28
| | | | | | | | | | | | | | Remove pre-standard restriction on explicitly-defaulted copy constructors with 'incorrect' parameter types, and instead just make those special members non-trivial as the standard requires. This required making CXXRecordDecl correctly handle classes which have both a trivial and a non-trivial special member of the same kind. This also fixes PR13217 by reimplementing DiagnoseNontrivial in terms of the new triviality computation technology. llvm-svn: 169667
* Implement C++03 [dcl.init]p5's checking for value-initialization of referencesRichard Smith2012-12-081-0/+6
| | | | | | | | properly, rather than faking it up by pretending that a reference member makes the default constructor non-trivial. That leads to rejects-valids when putting such types inside unions. llvm-svn: 169662
* Update source location in test.Benjamin Kramer2012-07-301-3/+2
| | | | llvm-svn: 160964
* Don't assert when trying to diagnose why a class with a constructor template isRichard Smith2012-02-261-0/+4
| | | | | | non-trivial. llvm-svn: 151486
* Make sure we still reject static data members in anonymous unions in C++11.Richard Smith2012-02-161-0/+12
| | | | llvm-svn: 150724
* C++11 allows unions to have static data members. Remove the correspondingRichard Smith2012-02-162-1/+38
| | | | | | restriction and add some tests. llvm-svn: 150721
* This test works now; enable it.John McCall2011-04-121-18/+16
| | | | llvm-svn: 129335
* A union cannot contain static data members or data members of reference type.Anders Carlsson2010-11-071-0/+8
| | | | llvm-svn: 118381
* Pretty-print anonymous types using their kind and presumed location.John McCall2010-03-191-7/+7
| | | | | | Fixes PR6643. Patch by Mike M! llvm-svn: 98946
* When pretty-printing tag types, only print the tag if we're in C (andJohn McCall2010-03-101-21/+21
| | | | | | | | | | therefore not creating ElaboratedTypes, which are still pretty-printed with the written tag). Most of these testcase changes were done by script, so don't feel too sorry for my fingers. llvm-svn: 98149
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - 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
* Make sure we actually have a definition before asking if it is implicit. ↵Sebastian Redl2009-10-251-0/+9
| | | | | | Fixes PR4674. llvm-svn: 85072
* Prep for new warning.Mike Stump2009-07-221-1/+1
| | | | llvm-svn: 76772
* "This patch implements the restrictions on union members detailed inDouglas Gregor2009-07-221-0/+105
[class.union]p1", from John McCall! llvm-svn: 76766
OpenPOWER on IntegriCloud