summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/default2.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Detect recursive default argument definitionSerge Pavlov2016-06-141-0/+4
| | | | | | | | | | | | If definition of default function argument uses itself, clang crashed, because corresponding function parameter is not associated with the default argument yet. With this fix clang emits appropriate error message. This change fixes PR28105. Differential Revision: http://reviews.llvm.org/D21301 llvm-svn: 272623
* Ensure typos in the default values of template parameters get diagnosed.Kaelyn Takata2014-12-021-0/+6
| | | | llvm-svn: 223177
* Improve diagnostics for invalid use of non-static members / this:Richard Smith2012-04-051-5/+5
| | | | | | | | | | | | * 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
* Parse default arguments within member functions in source order, fromDouglas Gregor2010-10-121-0/+3
| | | | | | Manuel Klimek! Fixes PR7715. llvm-svn: 116311
* Whenever we complain about a failed initialization of a function orDouglas Gregor2010-04-221-1/+2
| | | | | | | | | | | | | | | | | method parameter, provide a note pointing at the parameter itself so the user does not have to manually look for the function/method being called and match up parameters to arguments. For example, we now get: t.c:4:5: warning: incompatible pointer types passing 'long *' to parameter of type 'int *' [-pedantic] f(long_ptr); ^~~~~~~~ t.c:1:13: note: passing argument to parameter 'x' here void f(int *x); ^ llvm-svn: 102038
* When pretty-printing tag types, only print the tag if we're in C (andJohn McCall2010-03-101-2/+2
| | | | | | | | | | 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
* Add 'previous declaration is here' note for param redefinition Chris Lattner2010-02-221-1/+2
| | | | | | | | | | | | | errors, e.g.: t.c:1:21: error: redefinition of parameter 'x' int test(int x, int x); ^ t.c:1:14: note: previous declaration is here int test(int x, int x); ^ llvm-svn: 96769
* Improve the diagnostics used to report implicitly-generated class membersJohn McCall2010-01-061-2/+2
| | | | | | | | | as parts of overload sets. Also, refer to constructors as 'constructors' rather than functions. Adjust a lot of tests. llvm-svn: 92832
* Switch Sema::AddCXXDirectInitializerToDecl over to InitializationSequenceDouglas Gregor2009-12-221-2/+2
| | | | llvm-svn: 91927
* Switch default-initialization of variables of class type (or array thereof) ↵Douglas Gregor2009-12-201-1/+1
| | | | | | over to InitializationSequence. I could swear that this fixes a PR somewhere, but I couldn't figure out which one llvm-svn: 91796
* 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
* Cleanup and test C++ default arguments. Improvements include:Douglas Gregor2009-09-111-16/+0
| | | | | | | | | | | - Diagnose attempts to add default arguments to templates (or member functions of templates) after the initial declaration (DR217). - Improve diagnostics when a default argument is redefined. Now, the note will always point at the place where the default argument was previously defined, rather than pointing to the most recent declaration of the function. llvm-svn: 81548
* Fix the parsing of default arguments for inline member function Eli Friedman2009-07-221-0/+6
| | | | | | | | definitions. I'm not very familiar with this code, so please review. llvm-svn: 76796
* It's an error to use a function declared in a class definition as a default ↵Anders Carlsson2009-06-121-2/+8
| | | | | | argument before the function has been declared. llvm-svn: 73234
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* Fix redundant errors with missing default arguments in member declarations.Sebastian Redl2009-02-081-3/+1
| | | | llvm-svn: 64085
* Make the test cases failing due to exact diagnostic matching XFAIL.Sebastian Redl2009-02-081-0/+3
| | | | llvm-svn: 64080
* Correct the order in which we cope with end-of-class-definitionDouglas Gregor2008-12-241-0/+12
| | | | | | | | | | | | | | | | | | | | | | semantics and improve our handling of default arguments. Specifically, we follow this order: - As soon as the see the '}' in the class definition, the class is complete and we add any implicit declarations (default constructor, copy constructor, etc.) to the class. - If there are any default function arguments, parse them - If there were any inline member function definitions, parse them As part of this change, we now keep track of the the fact that we've seen unparsed default function arguments within the AST. See the new ParmVarDecl::hasUnparsedDefaultArg member. This allows us to properly cope with calls inside default function arguments to other functions where we're making use of the default arguments. Made some C++ error messages regarding failed initializations more specific. llvm-svn: 61406
* Delay parsing of default arguments of member functions until the classDouglas Gregor2008-12-161-3/+34
| | | | | | | | | | is completely defined (C++ [class.mem]p2). Reverse the order in which we process the definitions of member functions specified inline. This way, we'll get diagnostics in the order in which the member functions were declared in the class. llvm-svn: 61103
* Make name lookup when we're inside a declarator's scope, such as ↵Douglas Gregor2008-12-161-0/+7
| | | | | | ClassName::func, work with the new unqualified name lookup code. Test it with default arguments in out-of-line member definitions llvm-svn: 61060
* Added a test for default arguments added to out-of-line memberDouglas Gregor2008-12-161-0/+26
| | | | | | | | functions. They work except that name lookup within the default arguments needs to be deferred until the class definition is complete (see FIXME in the test). llvm-svn: 61059
* Diagnose use of 'this' in a C++ default argument. Thanks to Eli for ↵Douglas Gregor2008-11-041-0/+4
| | | | | | correcting my bogus assertion about it already being handled llvm-svn: 58691
* Check that this cannot be used in a default argument. Happily, it was ↵Douglas Gregor2008-11-031-0/+4
| | | | | | already implemented llvm-svn: 58649
* Move the rest of the Sema C++ tests into the SemaCXX test directory.Argyrios Kyrtzidis2008-08-221-0/+38
llvm-svn: 55178
OpenPOWER on IntegriCloud