gcc/testsuite/g++.dg/cpp2a/inline-asm3.C
raw| 1 | // P1668R1: Permit unevaluated inline asm in constexpr functions |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | // { dg-additional-options "-Wno-pedantic" } |
| 4 | |
| 5 | constexpr int |
| 6 | foo () |
| 7 | { |
| 8 | constexpr int i = ({ asm(""); 42; }); // { dg-error "inline assembly is not a constant expression" } |
| 9 | return i; |
| 10 | } |
| 11 | |
| 12 | constexpr int i = foo (); // { dg-error "foo" } |