Commit 6c003020 by Paolo Carlini Committed by Paolo Carlini

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
parent 7053f7e1
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*.
......
// 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>();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment