diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2019-03-09 21:49:41 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2019-03-09 21:49:41 +0000 |
commit | 6c00302019fca2a2ffaf2e6b134b4140e505dace (patch) | |
tree | d982a14a83470689c893959f028e31130fe6d3c9 | |
parent | 7053f7e1997295711aaf1dd51a539815b45e204d (diff) | |
download | gcc-6c00302019fca2a2ffaf2e6b134b4140e505dace.zip gcc-6c00302019fca2a2ffaf2e6b134b4140e505dace.tar.gz gcc-6c00302019fca2a2ffaf2e6b134b4140e505dace.tar.bz2 |
re PR c++/87750 (Failed compilation / parsing of template member call after 'using' declaration)
2019-03-09 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/87750
* g++.dg/cpp0x/pr87750.C: New.
From-SVN: r269539
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/pr87750.C | 40 |
2 files changed, 45 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9d857bb..769a5e9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-03-09 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/87750 + * g++.dg/cpp0x/pr87750.C: New. + 2019-03-09 John David Anglin <dave.anglin@bell.net> * 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 0000000..6002e41 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr87750.C @@ -0,0 +1,40 @@ +// PR c++/87750 +// { dg-do compile { target c++11 } } + +template <typename T> +class Bar +{ +protected: + template <bool B> + int process(int) { return 0; } +}; + +template<typename T> +class Derived : Bar<T> +{ + using Base = Bar<T>; + // 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<false>(); + } + + template <bool B> + 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<B>(1); + } +}; + +int main() +{ + Derived<int> x; + return x.process<false>(); +} |