On Sat, 11 Nov 2023 at 02:06, Nima Hamidi via Gcc <gcc@gcc.gnu.org> wrote:
>
> Another similar issue is with alias templates. The following code:

Please report both cases to Bugzilla, thanks.


>
> ```
> template <typename T>
> struct Cls {
>  using ptr = T *;
> };
>
> template <typename T>
> using Cls_ptr = typename Cls<T>::ptr;
>
> Cls_ptr<int> ai;
> Cls_ptr<float> af;
> ```
>
> produces
>
> ```
> < 1><0x00000029> DW_TAG_typedef
>  DW_AT_type <0x0000003d>
>  DW_AT_name (indexed string: 0x00000008)Cls_ptr<int>
>  DW_AT_decl_file 0x00000001 /main.cpp
>  DW_AT_decl_line 0x00000007
> ```
>
> by  clang, but produces the following by gcc. (Note the difference in 
> DW_AT_name’s.)
>
> ```
> < 1><0x00000044> DW_TAG_typedef
>  DW_AT_name Cls_ptr
>  DW_AT_decl_file 0x00000001
>  DW_AT_decl_line 0x00000007
>  DW_AT_decl_column 0x00000007
>  DW_AT_type <0x00000027>
> ```
> On Nov 10, 2023 at 7:59 PM -0600, Nima Hamidi <nimaa.ham...@gmail.com>, wrote:
> >
> > template <typename T>
> > struct Cls {
> >  static const int v = 0;
> > };
> >
> > template <typename T>
> > int constexpr Cls_v = Cls<T>::v;
> >
> > int func() {
> >  return Cls_v<int> + Cls_v<float>;
> > }

Reply via email to