summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/class
Commit message (Collapse)AuthorAgeFilesLines
...
* Disable our non-standard delayed parsing of exception specifications. DelayingRichard Smith2012-05-021-30/+0
| | | | | | | the parsing of such things appears to be a conforming extension, but it breaks libstdc++4.7's std::pair. llvm-svn: 155975
* PR12688: ParseCXXClassMemberDeclaration's sometimes-null ThisDecl takes anotherRichard Smith2012-04-291-0/+13
| | | | | | | victim. Don't crash if we have a delay-parsed exception specification for a class member which is invalid in a way which precludes building a FunctionDecl. llvm-svn: 155788
* Don't try to delay parsing the exception specification for a data member of aRichard Smith2012-04-241-1/+9
| | | | | | class; we would never actually parse it and attach it to the type. llvm-svn: 155426
* PR12629: Cope with parenthesized function types when attaching a delayedRichard Smith2012-04-241-1/+10
| | | | | | exception specification to a function. llvm-svn: 155424
* Implement the last part of C++ [class.mem]p2, delaying the parsing ofDouglas Gregor2012-04-161-0/+27
| | | | | | | | | exception specifications on member functions until after the closing '}' for the containing class. This allows, for example, a member function to throw an instance of its own class. Fixes PR12564 and a fairly embarassing oversight in our C++98/03 support. llvm-svn: 154844
* Improve diagnostics for invalid use of non-static members / this:Richard Smith2012-04-051-2/+2
| | | | | | | | | | | | * s/nonstatic/non-static/ in the diagnostics, since the latter form outvoted the former by 28-2 in our diagnostics. * Fix the "use of member in static member function" diagnostic to correctly detect this situation inside a block or lambda. * Produce a more specific "invalid use of non-static member" diagnostic for the case where a nested class member refers to a member of a lexically-surrounding class. llvm-svn: 154073
* 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
* Deal with a horrible C++11 special case. If a non-literal type has a constexprRichard Smith2012-02-131-3/+3
| | | | | | | | | | | constructor, and that constructor is used to initialize an object of static storage duration such that all members and bases are initialized by constant expressions, constant initialization is performed. In this case, the object can still have a non-trivial destructor, and if it does, we must emit a dynamic initializer which performs no initialization and instead simply registers that destructor. llvm-svn: 150419
* Update constexpr implementation to match CWG's chosen approach for core issuesRichard Smith2012-02-131-4/+3
| | | | | | | | | | | | | | | | | | | | 1358, 1360, 1452 and 1453. - Instantiations of constexpr functions are always constexpr. This removes the need for separate declaration/definition checking, which is now gone. - This makes it possible for a constexpr function to be virtual, if they are only dependently virtual. Virtual calls to such functions are not constant expressions. - Likewise, it's now possible for a literal type to have virtual base classes. A constexpr constructor for such a type cannot actually produce a constant expression, though, so add a special-case diagnostic for a constructor call to such a type rather than trying to evaluate it. - Classes with trivial default constructors (for which value initialization can produce a fully-initialized value) are considered literal types. - Classes with volatile members are not literal types. - constexpr constructors can be members of non-literal types. We do not yet use static initialization for global objects constructed in this way. llvm-svn: 150359
* PR11684, core issue 1417:Richard Smith2012-02-101-1/+1
| | | | | | | | | | | | | | o Correct the handling of the restrictions on usage of cv-qualified and ref-qualified function types. o Fix a bug where such types were rejected in template type parameter default arguments, due to such arguments not being treated as a template type arg context. o Remove the ExtWarn for usage of such types as template arguments; that was a standard defect, not a GCC extension. o Improve the wording and unify the code for diagnosing cv-qualifiers with the code for diagnosing ref-qualifiers. llvm-svn: 150244
* Remove the "unsupported" error for lambda expressions. It's annoying,Douglas Gregor2012-02-091-1/+1
| | | | | | and rapidly becoming untrue. llvm-svn: 150165
* Various interrelated cleanups for lambdas:Douglas Gregor2012-02-091-2/+2
| | | | | | | | | | | | | | - Complete the lambda class when we finish the lambda expression (previously, it was left in the "being completed" state) - Actually return the LambdaExpr object and bind to the resulting temporary when needed. - Detect when cleanups are needed while capturing a variable into a lambda (e.g., due to default arguments in the copy constructor), and make sure those cleanups apply for the whole of the lambda expression. llvm-svn: 150123
* Misc improvements to the diagnostic when a variable is odr-used in a context ↵Eli Friedman2012-02-073-2/+20
| | | | | | | | that is not allowed to capture variables. Fixes PR11883. llvm-svn: 149937
* Further testing for instantiation of out-of-line constexpr static data memberRichard Smith2012-01-191-0/+5
| | | | | | template definitions. llvm-svn: 148506
* An instantiation of a constexpr static data member in a class template isRichard Smith2012-01-191-0/+14
| | | | | | constexpr. llvm-svn: 148505
* Modify how the -verify flag works. Currently, the verification string andRichard Trieu2011-12-154-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | diagnostic message are compared. If either is a substring of the other, then no error is given. This gives rise to an unexpected case: // expect-error{{candidate function has different number of parameters}} will match the following error messages from Clang: candidate function has different number of parameters (expected 1 but has 2) candidate function has different number of parameters It will also match these other error messages: candidate function function has different number of parameters number of parameters This patch will change so that the verification string must be a substring of the diagnostic message before accepting. Also, all the failing tests from this change have been corrected. Some stats from this cleanup: 87 - removed extra spaces around verification strings 70 - wording updates to diagnostics 40 - extra leading or trailing characters (typos, unmatched parens or quotes) 35 - diagnostic level was included (error:, warning:, or note:) 18 - flag name put in the warning (-Wprotocol) llvm-svn: 146619
* Include named unions in union member init checkingDavid Blaikie2011-11-171-0/+26
| | | | llvm-svn: 144883
* constexpr: static data members declared constexpr are required to have anRichard Smith2011-11-071-1/+1
| | | | | | | | initializer; all other constexpr variables are merely required to be initialized. In particular, a user-provided constexpr default constructor can be used for such initialization. llvm-svn: 144028
* When we notice that a member function is defined with "= delete" or "=Douglas Gregor2011-11-071-0/+15
| | | | | | | | | | | | default", make a note of which is used when creating the initial declaration. Previously, we would wait until later to handle default/delete as a definition, but this is too late: when adding the declaration, we already treated the declaration as "user-provided" when in fact it was merely "user-declared". Fixes PR10861 and PR10442, along with a bunch of FIXMEs. llvm-svn: 144011
* Make the -Wc++11-compat warnings ignored by default, so we don't breakDouglas Gregor2011-10-251-1/+1
| | | | | | | valid C++98/03 code. However, add these warnings to -Wall, for those who obviously already like clean code. llvm-svn: 142903
* In C++11, a class's members are allowed to be nominated as friends.Richard Smith2011-10-181-0/+12
| | | | llvm-svn: 142393
* Update all tests other than Driver/std.cpp to use -std=c++11 rather thanRichard Smith2011-10-138-8/+8
| | | | | | -std=c++0x. Patch by Ahmed Charles! llvm-svn: 141900
* Switch diagnostic text from "C++0x" over to "C++11".Douglas Gregor2011-10-122-2/+2
| | | | | | | | We'd also like for "C++11" or "c++11" to be used for the warning groups, but without removing the old warning flags. Patches welcome; I've run out of time to work on this today. llvm-svn: 141801
* Per C++ [class.bit]p2, unnamed bit-fields are not members. Fixes PR10289.Douglas Gregor2011-10-101-0/+22
| | | | llvm-svn: 141549
* 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
OpenPOWER on IntegriCloud