[Bug c++/92739] New: [Trunk Regression] Requires clause followed by an attribute no longer compiles
cjdb.ns at gmail dot com
gcc-bugzilla@gcc.gnu.org
Sun Dec 1 00:27:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92739
Bug ID: 92739
Summary: [Trunk Regression] Requires clause followed by an
attribute no longer compiles
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: cjdb.ns at gmail dot com
Target Milestone: ---
Created attachment 47401
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47401&action=edit
Preprocessed file for broken build
The following code works in 466691493b9, but not in commits starting from Git
hash 6b42dfe4264.
```
template<typename T>
requires true
[[deprecated]] void f()
{}
```
# Diagnostic
test.cpp:2:1: error: expression must be enclosed in parentheses
2 | requires true
| ^~~~~~~~
test.cpp:2:10: error: expected unqualified-id before 'true'
2 | requires true
| ^~~~
# Built using
/usr/local/bin/g++-10 -std=c++2a test.cpp
# System type
* Ubuntu 18.04 via WSL
* Ubuntu 18.04 via a Docker image
# GCC configured with
```
export CC=/usr/local/bin/gcc-10 \
CXX=/usr/local/bin/g++-10 \
CFLAGS='-O3 -DNDEBUG -g0' \
CXXFLAGS='-O3 -DNDEBUG -g0' \
CPPFLAGS="$CXXFLAGS"
../gcc/configure --disable-multilib \
--disable-nls \
--disable-bootstrap \
--enable-languages=c,c++ \
--disable-werror \
--with-diagnostics-color=always \
--with-ld=/usr/bin/gold
```
More information about the Gcc-bugs
mailing list