Translate CXXNoexceptExpr

Reviewed By: akotulski

Differential Revision: D3481942

fbshipit-source-id: ff4df1a
master
Dulma Churchill 9 years ago committed by Facebook Github Bot
parent 8bfa983716
commit edc57f70f5

@ -1 +1 @@
Subproject commit 1b6e6183affe497bcbe3cb6c37c3065d4ecbb91e
Subproject commit 815fde847bdb2e244c2c9509810601aaeab392f4

@ -369,6 +369,9 @@ struct
let exp = Sil.Const (Sil.Cint (IntLit.of_int n)) in
{ empty_res_trans with exps = [(exp, typ)]}
let booleanValue_trans trans_state expr_info b =
characterLiteral_trans trans_state expr_info (Utils.int_of_bool b)
let floatingLiteral_trans trans_state expr_info float_string =
let typ = CTypes_decl.get_type_from_expr_info expr_info trans_state.context.CContext.tenv in
let exp = Sil.Const (Sil.Cfloat (float_of_string float_string)) in
@ -2586,8 +2589,10 @@ struct
attributedStmt_trans trans_state stmts attrs
| TypeTraitExpr (_, _, expr_info, type_trait_info) ->
let b = type_trait_info.Clang_ast_t.xtti_value in
characterLiteral_trans trans_state expr_info (Utils.int_of_bool b)
booleanValue_trans trans_state expr_info type_trait_info.Clang_ast_t.xtti_value
| CXXNoexceptExpr (_, _, expr_info, cxx_noexcept_expr_info) ->
booleanValue_trans trans_state expr_info cxx_noexcept_expr_info.Clang_ast_t.xnee_value
| s -> (Printing.log_stats
"\n!!!!WARNING: found statement %s. \nACTION REQUIRED: \

@ -0,0 +1,16 @@
/*
* Copyright (c) 2016 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
void throw1(){};
void no_throw() noexcept {};
int noexcept_in_no_throw_is_true() { return noexcept(no_throw()); }
int noexcept_in_throw1_is_false() { return noexcept(throw1()); }

@ -0,0 +1,39 @@
/* @generated */
digraph iCFG {
10 [label="10: Return Stmt \n *&return:int =0 [line 16]\n " shape="box"]
10 -> 9 ;
9 [label="9: Exit noexcept_in_throw1_is_false \n " color=yellow style=filled]
8 [label="8: Start noexcept_in_throw1_is_false\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 16]\n " color=yellow style=filled]
8 -> 10 ;
7 [label="7: Return Stmt \n *&return:int =1 [line 14]\n " shape="box"]
7 -> 6 ;
6 [label="6: Exit noexcept_in_no_throw_is_true \n " color=yellow style=filled]
5 [label="5: Start noexcept_in_no_throw_is_true\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 14]\n " color=yellow style=filled]
5 -> 7 ;
4 [label="4: Exit no_throw \n " color=yellow style=filled]
3 [label="3: Start no_throw\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled]
3 -> 4 ;
2 [label="2: Exit throw1 \n " color=yellow style=filled]
1 [label="1: Start throw1\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 10]\n " color=yellow style=filled]
1 -> 2 ;
}

@ -35,4 +35,10 @@ public class ExceptionsTest {
frontendTest("Exceptions.cpp");
}
@Test
public void testNoExceptionExprDotFilesMatch()
throws InterruptedException, IOException, InferException {
frontendTest("noexception.cpp");
}
}

Loading…
Cancel
Save