summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/return.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix typo-correction crash if a typo occurs within the operand of aRichard Smith2016-06-301-1/+1
| | | | | | | | | function-style cast to a non-dependent type which is then used in an invalid way. We'd lose the "type dependent" bit here, and downstream Sema processing would then discard the expression if it was used in a context where its type rendered it invalid. llvm-svn: 274267
* Remove an assert that's not true on invalid code.Nico Weber2015-01-041-0/+8
| | | | | | | | | | r185773 added an assert that checked that a CXXUnresolvedConstructExpr either has a valid rparen, or exactly one argument. This doesn't have to be true for invalid inputs. Convert the assert to an if, and add a test for this case. Found by SLi's afl bot. llvm-svn: 225140
* Issue diagnostic when constructor or destructorFariborz Jahanian2013-12-031-0/+10
| | | | | | | return void expression. // rdar://15366494 pr17759. llvm-svn: 196296
* For -Wignored-qualifiers, don't warn on qualifiers which we acquire via aRichard Smith2013-03-281-2/+1
| | | | | | | typedef. Also don't warn on the _Atomic type specifier, just on the _Atomic type qualifier. llvm-svn: 178218
* Teach -Wigored-qualifiers about exotic flavors of declarator and the _Atomic ↵Richard Smith2013-03-281-1/+24
| | | | | | type qualifier. llvm-svn: 178217
* Move test/Sema/return.cpp into test/SemaCXX/return.cppHans Wennborg2011-06-301-0/+11
| | | | llvm-svn: 134171
* Make -Wignored-qualifiers point to the first ignored qualifier.Hans Wennborg2011-06-031-0/+5
| | | | | | | | In code such as "char* volatile const j()", Clang warns that "volatile const" will be ignored. Make it point to the first ignored qualifier, and simplify the code a bit. llvm-svn: 132563
* Even a return statement of an expression with a dependent type in a voidNick Lewycky2011-06-011-0/+11
| | | | | | function might need to clean up its temporaries. Fixes PR10057. llvm-svn: 132390
* Fix PR9453 by not trying to print a warning about ignored qualifiersRafael Espindola2011-03-111-0/+4
| | | | | | in conversion functions. llvm-svn: 127460
* When digging into a cv-qualified return type that is a pointer type toDouglas Gregor2011-03-011-0/+8
| | | | | | | | diagnose ignored qualifiers on return types, only assume that there is a pointer chunk if the type is *structurally* a pointer type, not if it's a typedef of a pointer type. Fixes PR9328/<rdar://problem/9055428>. llvm-svn: 126751
* Add -fcxx-exceptions to all tests that use C++ exceptions.Anders Carlsson2011-02-281-1/+1
| | | | llvm-svn: 126599
* Fix the behavior of -Wignored-qualifiers on return type qualifiers inChandler Carruth2011-02-231-0/+15
| | | | | | | | | | several ways. We now warn for more of the return types, and correctly locate the ignored ones. Also adds fix-it hints to remove the ignored qualifiers. Fixes much of PR9058, although not all of it. Patch by Hans Wennborg, a couple of minor style tweaks from me. llvm-svn: 126321
* Pass -fexceptions to all tests that use try/catch/throw.Anders Carlsson2011-02-191-1/+1
| | | | llvm-svn: 126037
* Wire up '-Wignored-qualifiers' to the warning on 'const' in 'const int f()'.Chandler Carruth2010-07-141-1/+11
| | | | | | | | | This flag and warning match GCC semantics. Also, move it to -Wextra as this is a largely cosmetic issue and doesn't seem to mask problems. Subsequent fixes to the tests which no longer by default emit the warning. Added explicit test cases for both C and C++ behavior with the warning turned on. llvm-svn: 108325
* 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
* When the return type of a function is dependent, don't perform anyDouglas Gregor2009-10-011-0/+13
| | | | | | | | | | | | of the flow-control checks for falling off the end of a function, since the return type may instantiate to void. Similarly, if a return statement has an expression and the return type of the function is void, don't complain if the expression is type-dependent, since that type could instantiate to void. Fixes PR5071. llvm-svn: 83222
* Add warning for falling off the end of a function that should return aMike Stump2009-07-221-0/+5
value. This is on by default, and controlled by -Wreturn-type (-Wmost -Wall). I believe there should be very few false positives, though the most interesting case would be: int() { bar(); } when bar does: bar() { while (1) ; } Here, we assume functions return, unless they are marked with the noreturn attribute. I can envision a fixit note for functions that never return normally that don't have a noreturn attribute to add a noreturn attribute. If anyone spots other false positives, let me know! llvm-svn: 76821
OpenPOWER on IntegriCloud