[Bug c++/91346] Implement P1668R1: Permit unevaluated inline asm in constexpr functions

2019-08-07 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91346

Marek Polacek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Marek Polacek  ---
Implemented for 10.1.

[Bug c++/91346] Implement P1668R1: Permit unevaluated inline asm in constexpr functions

2019-08-07 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91346

--- Comment #1 from Marek Polacek  ---
Author: mpolacek
Date: Wed Aug  7 14:20:40 2019
New Revision: 274169

URL: https://gcc.gnu.org/viewcvs?rev=274169=gcc=rev
Log:
PR c++/91346 - Implement P1668R1, allow unevaluated asm in constexpr.
* constexpr.c (cxx_eval_constant_expression): Handle ASM_EXPR.
(potential_constant_expression_1) : Allow.
* cp-tree.h (finish_asm_stmt): Adjust.
* parser.c (cp_parser_asm_definition): Grab the locaion of "asm" and
use it.  Change an error to a pedwarn.  Allow asm in C++2a, warn
otherwise.
* pt.c (tsubst_expr): Pass a location down to finish_asm_stmt.
* semantics.c (finish_asm_stmt): New location_t parameter.  Use it.

* g++.dg/cpp2a/inline-asm1.C: New test.
* g++.dg/cpp2a/inline-asm2.C: New test.
* g++.dg/cpp1y/constexpr-neg1.C: Adjust dg-error.

Added:
trunk/gcc/testsuite/g++.dg/cpp2a/inline-asm1.C
trunk/gcc/testsuite/g++.dg/cpp2a/inline-asm2.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/constexpr.c
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/parser.c
trunk/gcc/cp/pt.c
trunk/gcc/cp/semantics.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/cpp1y/constexpr-neg1.C

[Bug c++/91346] Implement P1668R1: Permit unevaluated inline asm in constexpr functions

2019-08-04 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91346

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2019-08-04
   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org
 Ever confirmed|0   |1