llvm-project/clang/lib/Sema
David Majnemer 7f77eb90a5 [Sema] Don't crash trying to diagnose abs called on a pointer type
Clang tries to figure out if a call to abs is suspicious by looking
through implicit casts to look at the underlying, implicitly converted
type.
Interestingly, C has implicit conversions from pointer-ish types like
function to less exciting types like int.  This trips up our 'abs'
checker because it doesn't know which variant of 'abs' is appropriate.

Instead, diagnose 'abs' called on function types upfront.  This sort of
thing is highly suspicious and is likely indicative of a missing
pointer dereference/function call/array index operation.

This fixes PR25532.

llvm-svn: 253156
2015-11-15 03:04:34 +00:00
..
AnalysisBasedWarnings.cpp Use Sema::getLocForEndOfToken instead of Preprocessor::getLocForEndOfToken. NFC 2015-11-15 02:31:46 +00:00
AttributeList.cpp Roll-back r250822. 2015-10-20 13:23:58 +00:00
CMakeLists.txt [coroutines] Initial stub Sema functionality for handling coroutine await / yield / return. 2015-10-22 06:13:50 +00:00
CodeCompleteConsumer.cpp Roll-back r250822. 2015-10-20 13:23:58 +00:00
DeclSpec.cpp Move diagnostics from Parse to Sema to remove Sema's dependency on ParserDiagnostic.h diagnostics. 2015-11-14 19:31:56 +00:00
DelayedDiagnostic.cpp Add -Wpartial-availability. 2015-03-19 19:18:22 +00:00
IdentifierResolver.cpp [modules] Remove redundant import of lexical decls when building a lookup table 2015-03-23 03:25:59 +00:00
JumpDiagnostics.cpp Some minor ARC diagnostic improvements. 2015-10-21 18:06:38 +00:00
Makefile
MultiplexExternalSemaSource.cpp Roll-back r250822. 2015-10-20 13:23:58 +00:00
Scope.cpp MS ABI: Implement the MSVC 2015 scheme for scope disambiguation 2015-03-19 21:54:30 +00:00
ScopeInfo.cpp Properly clear current coroutine promise on FunctionScopeInfo reuse. Should 2015-10-27 07:47:45 +00:00
Sema.cpp Use Sema::getLocForEndOfToken instead of Preprocessor::getLocForEndOfToken. NFC 2015-11-15 02:31:46 +00:00
SemaAccess.cpp -Wdeprecated: SavedInstanceContext is returned by value but isn't really copyable, but it can be made movable 2015-08-12 22:58:10 +00:00
SemaAttr.cpp Implement section pragma feedback on r205810 2015-03-04 23:39:17 +00:00
SemaCUDA.cpp [CUDA] Allow function overloads in CUDA based on host/device attributes. 2015-09-22 17:22:59 +00:00
SemaCXXScopeSpec.cpp Avoid duplicated diagnostic when lookup for a nested-name-specifier fails due to ambiguity. 2015-11-12 22:40:09 +00:00
SemaCast.cpp Define weak and __weak to mean ARC-style weak references, even in MRC. 2015-10-22 18:38:17 +00:00
SemaChecking.cpp [Sema] Don't crash trying to diagnose abs called on a pointer type 2015-11-15 03:04:34 +00:00
SemaCodeComplete.cpp Define weak and __weak to mean ARC-style weak references, even in MRC. 2015-10-22 18:38:17 +00:00
SemaConsumer.cpp
SemaCoroutine.cpp [coroutines] Creation of promise object, lookup of operator co_await, building 2015-10-27 06:02:45 +00:00
SemaDecl.cpp Move diagnostics from Parse to Sema to remove Sema's dependency on ParserDiagnostic.h diagnostics. 2015-11-14 19:31:56 +00:00
SemaDeclAttr.cpp Use Sema::getLocForEndOfToken instead of Preprocessor::getLocForEndOfToken. NFC 2015-11-15 02:31:46 +00:00
SemaDeclCXX.cpp Use Sema::getLocForEndOfToken instead of Preprocessor::getLocForEndOfToken. NFC 2015-11-15 02:31:46 +00:00
SemaDeclObjC.cpp Use Sema::getLocForEndOfToken instead of Preprocessor::getLocForEndOfToken. NFC 2015-11-15 02:31:46 +00:00
SemaExceptionSpec.cpp [coroutines] Creation of promise object, lookup of operator co_await, building 2015-10-27 06:02:45 +00:00
SemaExpr.cpp Use Sema::getLocForEndOfToken instead of Preprocessor::getLocForEndOfToken. NFC 2015-11-15 02:31:46 +00:00
SemaExprCXX.cpp Use Sema::getLocForEndOfToken instead of Preprocessor::getLocForEndOfToken. NFC 2015-11-15 02:31:46 +00:00
SemaExprMember.cpp Look through using decls when classifying implicit member access 2015-10-20 18:12:08 +00:00
SemaExprObjC.cpp Use Sema::getLocForEndOfToken instead of Preprocessor::getLocForEndOfToken. NFC 2015-11-15 02:31:46 +00:00
SemaFixItUtils.cpp Use Sema::getLocForEndOfToken instead of Preprocessor::getLocForEndOfToken. NFC 2015-11-15 02:31:46 +00:00
SemaInit.cpp [Sema] Make `&function_with_enable_if_attrs` an error 2015-10-12 19:57:04 +00:00
SemaLambda.cpp N3922: direct-list-initialization of an auto-typed variable no longer deduces a 2015-11-11 01:36:17 +00:00
SemaLookup.cpp DR407: Rationalize how we handle tags being hidden by typedefs. Even with 2015-11-12 22:04:34 +00:00
SemaObjCProperty.cpp Simplify Sema::ProcessPropertyDecl. NFC 2015-11-03 17:02:34 +00:00
SemaOpenMP.cpp [coroutines] Add overloaded unary 'operator co_await'. 2015-10-22 05:12:22 +00:00
SemaOverload.cpp [modules] Follow the C++ standard's rule for linkage of enumerators: they have 2015-11-13 03:52:13 +00:00
SemaPseudoObject.cpp Roll-back r250822. 2015-10-20 13:23:58 +00:00
SemaStmt.cpp Tweak how -Wunused-value interacts with macros 2015-10-27 19:47:40 +00:00
SemaStmtAsm.cpp Use ArrayRef and MutableArrayRef instead of a pointer and size. NFC 2015-10-21 02:34:10 +00:00
SemaStmtAttr.cpp Add new llvm.loop.unroll.enable metadata for use with "#pragma unroll". 2015-08-10 17:29:39 +00:00
SemaTemplate.cpp [Sema] Implement __make_integer_seq 2015-11-04 03:40:30 +00:00
SemaTemplateDeduction.cpp Add support for GCC's '__auto_type' extension, per the GCC manual: 2015-11-11 02:02:15 +00:00
SemaTemplateInstantiate.cpp Revert r107690 (for PR7417) and add a testcase that it breaks. The approach of 2015-10-05 20:05:21 +00:00
SemaTemplateInstantiateDecl.cpp [Sema] Implement __make_integer_seq 2015-11-04 03:40:30 +00:00
SemaTemplateVariadic.cpp Add support for GCC's '__auto_type' extension, per the GCC manual: 2015-11-11 02:02:15 +00:00
SemaType.cpp Move diagnostics from Parse to Sema to remove Sema's dependency on ParserDiagnostic.h diagnostics. 2015-11-14 19:31:56 +00:00
TreeTransform.h Add support for GCC's '__auto_type' extension, per the GCC manual: 2015-11-11 02:02:15 +00:00
TypeLocBuilder.cpp [C++11] Use 'nullptr'. Sema edition. 2014-05-26 06:22:03 +00:00
TypeLocBuilder.h Revert r240270 ("Fixed/added namespace ending comments using clang-tidy"). 2015-06-22 23:07:51 +00:00