On Mar 23, 2018, Jakub Jelinek <[email protected]> wrote:
> On Wed, Mar 21, 2018 at 11:52:33PM -0400, Jason Merrill wrote:
>> OK, thanks.
> Note the testcase FAILs with -fconcepts when I do make check-c++-all,
> FAIL: g++.dg/template/pr84789.C -std=c++17 -fconcepts (test for errors,
> line 12)
> FAIL: g++.dg/template/pr84789.C -std=c++17 -fconcepts (test for excess
> errors)
> Excess errors:
> /usr/src/gcc/gcc/testsuite/g++.dg/template/pr84789.C:12:15: error:
> 'A::I' {aka 'int'} is not a class type
> /usr/src/gcc/gcc/testsuite/g++.dg/template/pr84789.C:12:15: error: 'I'
> in 'A::I' {aka 'int'} does not name a type
Is this ok to install?
[PR c++/84789] adjust testcase for -fconcepts
When compiling with -fconcepts,
cp_parser_template_declaration_after_export calls
cp_parser_template_introduction and that preparses qualified-ids not
preceded by typename in such a way that, when we get to
cp_parser_parse_and_diagnose_invalid_type_name and then
cp_parser_diagnose_invalid_type_name, the nested name specifier no
longer carries the previous template-dependent context, so we don't
stand a chance to suggest the use of 'typename' any more. Thus,
tolerate in the testcase the poorer error messages we get.
for gcc/testsuite/ChangeLog
PR c++/84789
* g++.dg/template/pr84789.C: Adjust for testing with
-fconcepts too.
---
gcc/testsuite/g++.dg/template/pr84789.C | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/testsuite/g++.dg/template/pr84789.C
b/gcc/testsuite/g++.dg/template/pr84789.C
index bc1567f3fe77..63b9832fecf8 100644
--- a/gcc/testsuite/g++.dg/template/pr84789.C
+++ b/gcc/testsuite/g++.dg/template/pr84789.C
@@ -9,5 +9,5 @@ template<typename> struct B : A {};
template<typename T> struct C : B<T>
{
- B<T>::A::I::I i; // { dg-error "typename" }
+ B<T>::A::I::I i; // { dg-error "not a class type|does not name a
type|typename" }
};
--
Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/ FSF Latin America board member
Free Software Evangelist|Red Hat Brasil GNU Toolchain Engineer