llvm-project/clang/test/Analysis/container-modeling-no-aggressive-binary-operation-simplification-warn.cpp
Adam Balogh afcb77cc88 [Analyzer] Fix for incorrect use of container and iterator checkers
Iterator checkers (and planned container checkers) need the option
aggressive-binary-operation-simplification to be enabled. Without this
option they may cause assertions. To prevent such misuse, this patch adds
a preventive check which issues a warning and denies the registartion of
the checker if this option is disabled.

Differential Revision: https://reviews.llvm.org/D75171
2020-03-30 09:14:45 +02:00

8 lines
271 B
C++

// RUN: %clang_analyze_cc1 -std=c++11\
// RUN: -analyzer-checker=core,cplusplus,alpha.cplusplus.ContainerModeling\
// RUN: %s 2>&1 | FileCheck %s
// XFAIL: *
// CHECK: checker cannot be enabled with analyzer option 'aggressive-binary-operation-simplification' == false