This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/71784] [6/7 Regression] ICE on invalid code in push_access_scope, at cp/pt.c:229


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); 

}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]