summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/class
Commit message (Collapse)AuthorAgeFilesLines
...
* PR11067: A definition of a constexpr static variable doesn't need an ↵Richard Smith2011-10-061-1/+3
| | | | | | initializer if the in-class declaration had one. Such a declaration must be initialized by a constant expression. llvm-svn: 141279
* Suggest adding 'constexpr' if the GNU extension for in-class initializers ↵Richard Smith2011-09-301-1/+1
| | | | | | for static const float members is used in C++11 mode. llvm-svn: 140828
* Mark the ExtWarn for in-class initialization of static const float members ↵Richard Smith2011-09-291-2/+2
| | | | | | as a GNU extension. Don't extend the scope of this extension to all literal types in C++0x mode. llvm-svn: 140820
* constexpr: semantic checking for constexpr variables.Richard Smith2011-09-291-0/+24
| | | | | | We had an extension which allowed const static class members of floating-point type to have in-class initializers, 'as a C++0x extension'. However, C++0x does not allow this. The extension has been kept, and extended to all literal types in C++0x mode (with a fixit to add the 'constexpr' specifier). llvm-svn: 140801
* PR10458: Finesse behaviour of C++0x features when in pre-0x mode. Accept ↵Richard Smith2011-09-041-1/+1
| | | | | | for-range and auto with an ExtWarn, and produce a -Wc++0x-compat warning in C++98 mode when auto is used as a storage class. llvm-svn: 139102
* Test for C++11 [class]p6 (trivial classes).Richard Smith2011-06-121-0/+15
| | | | llvm-svn: 132889
* Implement support for C++11 in-class initialization of non-static data members.Richard Smith2011-06-111-0/+9
| | | | llvm-svn: 132878
* Tweak the diagnostics for the C++0x extensions to friend types to noteDouglas Gregor2011-05-101-2/+2
| | | | | | | | that they are C++0x extensions, and put them in the appropriate group. We already support most of the semantics. Addresses <rdar://problem/9407525>. llvm-svn: 131153
* Fix a typo in a test.Richard Trieu2011-05-041-1/+1
| | | | | | CHEKC -> CHECK llvm-svn: 130809
* Diagnose attempts to implicitly instantiate a template before it isJohn McCall2011-04-271-0/+31
| | | | | | fully defined. Somehow this escaped notice for a very long time. llvm-svn: 130298
* When creating an implicit member expression through a qualified-id, check ↵Argyrios Kyrtzidis2011-04-141-6/+11
| | | | | | | | | | that the class named by the nested-name-specifier is same or base of the class in which the member expression appears. It seems we also had an ill-formed test case, mon dieu! Fixes rdar://8576107. llvm-svn: 129493
* This test works now; enable it.John McCall2011-04-121-18/+16
| | | | llvm-svn: 129335
* Replace the call to ParseOptionalCXX0XClassVirtSpecifierSeq with code to ↵Anders Carlsson2011-03-251-4/+0
| | | | | | only parse an optional 'final' keyword. llvm-svn: 128278
* Remove warnings about using override control keywords in inline function ↵Anders Carlsson2011-03-251-13/+0
| | | | | | definitions; they will be allowed in the next C++0x draft. llvm-svn: 128273
* Remove 'new' from virt-specifier since it's going to be removed in the next ↵Anders Carlsson2011-03-252-3/+0
| | | | | | C++0x draft llvm-svn: 128271
* PR9037: Allow override, final, and new as an extension on inline members.Nico Weber2011-01-282-0/+42
| | | | llvm-svn: 124477
* Mark classes final and/or explicit during class template instantiation.Anders Carlsson2011-01-221-0/+20
| | | | llvm-svn: 124040
* Mark classes as final or explicit. Diagnose when a class marked 'final' is ↵Anders Carlsson2011-01-221-0/+8
| | | | | | used as a base. llvm-svn: 124039
* Parse class-virt-specifier-seqs.Anders Carlsson2011-01-221-0/+10
| | | | llvm-svn: 124036
* Fix tests to be valid.Anders Carlsson2011-01-201-2/+11
| | | | llvm-svn: 123887
* Change the parser error to reflect that virt-specifiers are allowed on any ↵Anders Carlsson2011-01-201-3/+3
| | | | | | class member. llvm-svn: 123883
* Only allow virtual member functions to be marked 'override' and 'final'.Anders Carlsson2011-01-201-0/+12
| | | | llvm-svn: 123882
* Change ParseOptionalCXX0XVirtSpecifierSeq to take a VirtSpecifiers struct.Anders Carlsson2011-01-171-0/+6
| | | | | | | Enforce C++[class.mem]p8: A virt-specifier-seq shall contain at most one of each virt-specifier. llvm-svn: 123611
* Forgot a file in r120182Sebastian Redl2010-11-261-0/+14
| | | | llvm-svn: 120184
* Allow access to non-static members without an object in sizeof expressions, ↵Sebastian Redl2010-11-261-3/+3
| | | | | | in C++0x. Patch by Jakub Wieczorek. llvm-svn: 120182
* A union cannot contain static data members or data members of reference type.Anders Carlsson2010-11-071-0/+8
| | | | llvm-svn: 118381
* Diagnose C++ [class.mem]p13-14, where a class member has the same nameDouglas Gregor2010-10-152-0/+59
| | | | | | as the class itself. Fixes PR7082. llvm-svn: 116573
* Make sure that we diagnose invalid qualifiers on friend functions.Douglas Gregor2010-10-141-1/+2
| | | | llvm-svn: 116527
* If we end up instantiating a function parameter whose default argumentDouglas Gregor2010-10-121-0/+27
| | | | | | | | | has not yet been parsed, note that the default argument hasn't been parsed and keep track of all of the instantiations of that function parameter. When its default argument does get parsed, imbue the instantiations with that default argument. Fixes PR8245. llvm-svn: 116324
* Parse default arguments within member functions in source order, fromDouglas Gregor2010-10-121-0/+46
| | | | | | Manuel Klimek! Fixes PR7715. llvm-svn: 116311
* Add redeclaration checking for static data members and fix a cornerDouglas Gregor2010-08-301-0/+64
| | | | | | | case with redeclaration checking for fields, from Faisal Vali! Fixes PR7970. llvm-svn: 112476
* Catch the case of trying to turn '&(X::a)' into a member pointer as well.John McCall2010-08-241-25/+0
| | | | llvm-svn: 111997
* When trying to resolve the address of an overloaded expression,John McCall2010-08-241-0/+25
| | | | | | | | only form pointers-to-member if the expression has the appropriate form. This avoids assertions later on on invalid code, but also allows us to properly resolve mixed-staticity overloads. llvm-svn: 111987
* Diagnose the presence of multiple initializations of static dataDouglas Gregor2010-08-241-0/+25
| | | | | | members, from Faisal Vali! Fixes PR6904. llvm-svn: 111900
* Turn access control on by default in -cc1.John McCall2010-04-092-2/+2
| | | | | | | | Remove -faccess-control from -cc1; add -fno-access-control. Make the driver pass -fno-access-control by default. Update a bunch of tests to be correct under access control. llvm-svn: 100880
* Improve handling of friend types in several ways:Douglas Gregor2010-04-071-2/+2
| | | | | | | | | | | - When instantiating a friend type template, perform semantic analysis on the resulting type. - Downgrade the errors concerning friend type declarations that do not refer to classes to ExtWarns in C++98/03. C++0x allows practically any type to be befriended, and ignores the friend declaration if the type is not a class. llvm-svn: 100635
* 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-103-23/+23
| | | | | | | | | | 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
* Make Decl::isOutOfLine() virtual, and use that to determine when definitionsChandler Carruth2010-02-211-0/+25
| | | | | | | are for out of line declarations more easily. This simplifies the logic and handles the case of out-of-line class definitions correctly. Fixes PR6107. llvm-svn: 96729
* Improve access control diagnostics. Perform access control on member-pointerJohn McCall2010-02-101-2/+2
| | | | | | | conversions. Fix an access-control bug where privileges were not considered at intermediate points along the inheritance path. Prepare for friends. llvm-svn: 95775
* Initialization improvements: addition of string initialization and a fewEli Friedman2009-12-191-2/+1
| | | | | | | | small bug fixes in SemaInit, switch over SemaDecl to use it more often, and change a bunch of diagnostics which are different with the new initialization code. llvm-svn: 91767
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-1512-12/+12
| | | | | | | | | - 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
* Stop trying to analyze class-hierarchies for dependently-scoped id-expressions;John McCall2009-12-021-0/+93
| | | | | | | | | | | | | there's nothing interesting we can say now that we're correctly not requiring the qualifier to name a known base class in dependent contexts. Require scope specifiers on member access expressions to name complete types if they're not dependent; delay lookup when they are dependent. Use more appropriate diagnostics when qualified implicit member access expressions find declarations from unrelated classes. llvm-svn: 90289
* Make sure we actually have a definition before asking if it is implicit. ↵Sebastian Redl2009-10-251-0/+9
| | | | | | Fixes PR4674. llvm-svn: 85072
* Improve diagnostics when the parser encounters a declarator with anDouglas Gregor2009-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | unknown type name, e.g., foo::bar x; when "bar" does not refer to a type in "foo". With this change, the parser now calls into the action to perform diagnostics and can try to recover by substituting in an appropriate type. For example, this allows us to easily diagnose some missing "typename" specifiers, which we now do: test/SemaCXX/unknown-type-name.cpp:29:1: error: missing 'typename' prior to dependent type name 'A<T>::type' A<T>::type A<T>::f() { return type(); } ^~~~~~~~~~ typename Fixes PR3990. llvm-svn: 84053
* Rework the Parse-Sema interaction for friends to better support friendDouglas Gregor2009-09-261-1/+3
| | | | | | | | | class templates. We now treat friend class templates much more like normal class templates, except that they still get special name lookup rules. Fixes PR5057 and eliminates a bunch of spurious diagnostics in <iostream>. llvm-svn: 82848
* When adding a friend class declaration to the lookup tables, use the access ↵John McCall2009-09-021-0/+4
| | | | | | | | | | specifier of any previous declaration in case we replace it in a class's declaration table. Fixes bug 4858. This sort of thing makes me reconsider putting friend declarations in declaration lists. llvm-svn: 80750
* Ensure that the tag decls of friend decls aren't added to the friending class'sJohn McCall2009-09-021-2/+0
| | | | | | | decl list, and remove some workarounds that were due to this. Thanks to Eli for pointing this out and providing the test case. llvm-svn: 80745
* Fix bug 4784 and allow friend declarations to properly extendJohn McCall2009-08-311-0/+37
| | | | | | existing declaration chains. llvm-svn: 80636
* Omnibus friend decl refactoring. Instead of cloning AST classes for friendJohn McCall2009-08-281-0/+7
| | | | | | | | | | | | | | declarations of same, introduce a single AST class and add appropriate bits (encoded in the namespace) for whether a decl is "real" or not. Much hackery about previously-declared / not-previously-declared, but it's essentially mandated by the standard that friends alter lookup, and this is at least fairly non-intrusive. Refactor the Sema methods specific to friends for cleaner flow and less nesting. Incidentally solve a few bugs, but I remain confident that we can put them back. llvm-svn: 80353
OpenPOWER on IntegriCloud