From: Paolo Carlini Date: Sat, 9 Mar 2019 21:49:41 +0000 (+0000) Subject: re PR c++/87750 (Failed compilation / parsing of template member call after 'using... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6c00302019fca2a2ffaf2e6b134b4140e505dace;p=gcc.git 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 --- 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(); +}