This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/71784] [6/7 Regression] ICE on invalid code in push_access_scope, at cp/pt.c:229
- From: "mct_ancs at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 08 Jul 2016 20:04:45 +0000
- Subject: [Bug c++/71784] [6/7 Regression] ICE on invalid code in push_access_scope, at cp/pt.c:229
- Auto-submitted: auto-generated
- References: <bug-71784-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71784
--- Comment #9 from Ela <mct_ancs at yahoo dot com> ---
(In reply to Ela from comment #8)
> (In reply to Martin Liška from comment #7)
>
> > Same as the origin, it's obviously an invalid code.
>
> Tested on all Clang-3.8 C++11,14,17 - it works.
>
> gcc-6.1.0 is a bit more explicit in some sense:
> - class instantiation w/ external leaves all
> members non-inst.
> - the missing function in the call (in main() )
> is written as some mangle, and not in_clear
> (as it would be with other functions - that
> one can add for test)
> - thus seems as a lack of internal repres. or
> something.
>
> Else please enlighten me on the correct syntax.
... actually I made it simpler, in order to get to
the root of it:
--------------------------------------------------
#include <iostream>
using std::cout;
template<typename T>
class A{
public:
template<typename U>
void f(U const&) & ;
template<typename U>
void f(U const&) && ;
};
template<typename T>
template<typename U>
void A<T>::f(U const& x) & { std::cout << "lvalue object\n" ; }
template<typename T>
template<typename U>
void A<T>::f(U const& x) && { std::cout << "rvalue object\n" ; }
template class A<int> ;
template void A<int>::f<int>(int const&) & ;
template void A<float>::f<int>(int const&) &&;
int main(){
A<int> a ;
a.f<int>(2);
A<float>().f<int>(1);
}