From 285933f8ca633495e7e4d03481a58ead3323c504 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Thu, 7 Jun 2018 15:26:02 +0200 Subject: Remove the `_Alignas(expr)` construct (#125) The `_Alignas(expr)` construct is not C11, only `_Alignas(type)` is. --- cparser/Elab.ml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'cparser/Elab.ml') diff --git a/cparser/Elab.ml b/cparser/Elab.ml index e9a17042..8a643362 100644 --- a/cparser/Elab.ml +++ b/cparser/Elab.ml @@ -1804,15 +1804,7 @@ let elab_expr ctx loc env a = error "invalid application of 'sizeof' to an incomplete type %a" (print_typ env) ty; { edesc = ESizeof ty; etyp = TInt(size_t_ikind(), []) },env' - | EXPR_ALIGNOF a1 -> - let b1,env = elab env a1 in - if wrap incomplete_type loc env b1.etyp then - error "invalid application of '_Alignof' to an incomplete type %a" (print_typ env) b1.etyp; - if wrap is_bitfield loc env b1 then - error "invalid application of '_Alignof' to a bit-field"; - { edesc = EAlignof b1.etyp; etyp = TInt(size_t_ikind(), []) },env - - | TYPE_ALIGNOF (spec, dcl) -> + | ALIGNOF (spec, dcl) -> let (ty, env') = elab_type loc env spec dcl in warning Celeven_extension "'_Alignof' is a C11 extension"; if wrap incomplete_type loc env' ty then -- cgit