From 6c00302019fca2a2ffaf2e6b134b4140e505dace Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Sat, 9 Mar 2019 21:49:41 +0000 Subject: [PATCH] re PR c++/87750 (Failed compilation / parsing of template member call after 'using' declaration) 2019-03-09 Paolo Carlini PR c++/87750 * g++.dg/cpp0x/pr87750.C: New. From-SVN: r269539 --- gcc/testsuite/ChangeLog | 5 ++++ gcc/testsuite/g++.dg/cpp0x/pr87750.C | 40 ++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/pr87750.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9d857bb4bf1..769a5e99191 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-03-09 Paolo Carlini + + PR c++/87750 + * g++.dg/cpp0x/pr87750.C: New. + 2019-03-09 John David Anglin * c-c++-common/ident-0b.c: Also skip on 32-bit hppa*-*-hpux*. diff --git a/gcc/testsuite/g++.dg/cpp0x/pr87750.C b/gcc/testsuite/g++.dg/cpp0x/pr87750.C new file mode 100644 index 00000000000..6002e411148 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr87750.C @@ -0,0 +1,40 @@ +// PR c++/87750 +// { dg-do compile { target c++11 } } + +template +class Bar +{ +protected: + template + int process(int) { return 0; } +}; + +template +class Derived : Bar +{ + using Base = Bar; + // Note applying Base::template workaround in (2) and commenting + // this out then compiles. + using Base::process; +public: + void foo() + { + // (1) workaround: this->template + // This line only fails on gcc 8.x, works in clang/icc/msvc. + process(); + } + + template + int process() + { + // (2) workaround: this->template or Base::template + // Note clang 5 & 6 don't accept this line either, but clang 7 does. + return process(1); + } +}; + +int main() +{ + Derived x; + return x.process(); +} -- 2.30.2