aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/return.cpp
AgeCommit message (Collapse)Author
2013-03-28For -Wignored-qualifiers, don't warn on qualifiers which we acquire via aRichard Smith
typedef. Also don't warn on the _Atomic type specifier, just on the _Atomic type qualifier. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178218 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28Teach -Wigored-qualifiers about exotic flavors of declarator and the _Atomic ↵Richard Smith
type qualifier. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178217 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-30Move test/Sema/return.cpp into test/SemaCXX/return.cppHans Wennborg
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134171 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-03Make -Wignored-qualifiers point to the first ignored qualifier.Hans Wennborg
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132563 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-01Even a return statement of an expression with a dependent type in a voidNick Lewycky
function might need to clean up its temporaries. Fixes PR10057. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132390 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-11Fix PR9453 by not trying to print a warning about ignored qualifiersRafael Espindola
in conversion functions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127460 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01When digging into a cv-qualified return type that is a pointer type toDouglas Gregor
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>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126751 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28Add -fcxx-exceptions to all tests that use C++ exceptions.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126599 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-23Fix the behavior of -Wignored-qualifiers on return type qualifiers inChandler Carruth
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126321 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19Pass -fexceptions to all tests that use try/catch/throw.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126037 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14Wire up '-Wignored-qualifiers' to the warning on 'const' in 'const int f()'.Chandler Carruth
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108325 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar
- 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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91446 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-01When the return type of a function is dependent, don't perform anyDouglas Gregor
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83222 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-22Add warning for falling off the end of a function that should return aMike Stump
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! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76821 91177308-0d34-0410-b5e6-96231b3b80d8