On Wed, Mar 6, 2019 at 6:39 PM Jakub Jelinek <ja...@redhat.com> wrote: > > The following patch tries to improve diagnostics of toplevel asm qualifiers > in C++ by actually parsing them and complaining if they appear at toplevel, > instead of just emitting a parse error that ( is expected, e.g. some > versions of Qt do use toplevel asm volatile and apparently the Qt code is > copied into lots of various projects. > > In addition to that, it mentions in the documentation that qualifiers are > not allowed at toplevel asm statements; apparently our documentation at > least from r220506 for GCC 5 says that at toplevel Basic Asm needs to be > used and for Basic Asm lists volatile qualifier as optional and its behavior > (that it is ignored for Basic Asm). Makes me wonder if we don't want to > keep accepting/ignoring volatile at toplevel for both C and C++ instead of > rejecting it (and rejecting just the other qualifiers). Thoughts on this?
That seems reasonable. Or using warning or permerror instead of error. > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > > Attached is an untested backport of this patch to 8.4, which does allow > asm volatile at toplevel, so that we don't break in 8.4 what has been > accepted in 8.2. Ok if it passes bootstrap/regtest there? Both OK. Jason