diff options
author | Marek Polacek <polacek@redhat.com> | 2021-04-19 16:21:46 -0400 |
---|---|---|
committer | Marek Polacek <polacek@redhat.com> | 2021-04-19 16:35:00 -0400 |
commit | 29d8838c5ecaf70ce552fea7639ec1f34adb2e04 (patch) | |
tree | 5d18c2036d00214ef045e3afa9828b3918d52301 /libphobos/libdruntime/gcc | |
parent | 329d2f0df7d6d22c87ab3338b94caef68139cd58 (diff) | |
download | gcc-29d8838c5ecaf70ce552fea7639ec1f34adb2e04.zip gcc-29d8838c5ecaf70ce552fea7639ec1f34adb2e04.tar.gz gcc-29d8838c5ecaf70ce552fea7639ec1f34adb2e04.tar.bz2 |
c++: ICE with concept defined in function [PR97536]
This is an ICE-on-invalid, but I keep seeing it when reducing code so
I'd like to fix it. We crash on
template <typename> void forward() {
concept C = true;
}
which breaks two requirements:
[temp.concept]/1: A concept is a template ...
[temp.concept]/3: A concept-definition shall inhabit a namespace scope.
This patch adds a test that exercises broken code and fixes the ICE
by checking that a concept-definition is defined at namespace scope.
gcc/cp/ChangeLog:
PR c++/97536
* decl.c (grokvardecl): Given an error when a concept is not defined
at namespace scope.
gcc/testsuite/ChangeLog:
PR c++/97536
* g++.dg/concepts/diagnostic16.C: New test.
Diffstat (limited to 'libphobos/libdruntime/gcc')
0 files changed, 0 insertions, 0 deletions