CBMC
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
cpp_typecheck_static_assert.cpp
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: C++ Language Type Checking
4
5Author: Daniel Kroening, kroening@cs.cmu.edu
6
7\*******************************************************************/
8
11
12#include "cpp_typecheck.h"
13
15
17{
20
23
24 if(cpp_static_assert.op0().is_false())
25 {
26 // failed
27 error().source_location=cpp_static_assert.source_location();
28 error() << "static assertion failed";
30 error() << ": " << to_string_constant(cpp_static_assert.op1()).value();
31 error() << eom;
32 throw 0;
33 }
34}
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
virtual void make_constant(exprt &expr)
virtual void implicit_typecast_bool(exprt &expr)
void convert(cpp_linkage_spect &)
void typecheck_expr(exprt &) override
source_locationt source_location
Definition message.h:239
mstreamt & error() const
Definition message.h:391
static eomt eom
Definition message.h:289
C++ Language Type Checking.
const string_constantt & to_string_constant(const exprt &expr)