[cfe-dev] Help with integral template argument suffix and cast printing

Pratyush Das via cfe-dev cfe-dev at lists.llvm.org
Tue Jul 21 06:06:44 PDT 2020


Hi,

I am a little stuck with https://reviews.llvm.org/D77598 and would really
appreciate any help.

I am trying to get the proper suffixes in the error messages for the
following two examples -

template<auto N> struct S {};
template<> struct S<1> { using type = int };
S<1L>::type t;

which should give the error message with a suffix -
error: no type named 'type' in 'S<1L>'; did you mean 'S<1>::type'?

and

template <unsigned long long N> struct enable_if_unsigned_long_long {};
template <> struct enable_if_unsigned_long_long<1> { typedef int type; };
void test_unsigned_long_long() { enable_if_unsigned_long_long<2>::type i; }

which should give no suffix in the error message -
error: no type named 'type' in 'enable_if_unsigned_int<2>'; did you mean
'enable_if_unsigned_int<1>::type'?

I am trying to find the correct combination that would enable suffix in the
first case, but not in the second case. I have been tinkering with checks
for DeducedType and DependentType, but always either the suffixes are
disabled for both the cases, or enabled for both the cases.

Can anyone please provide any insight on how to proceed?

Thanks!

-- 
Pratyush Das(Reik)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200721/f98daf0a/attachment.html>


More information about the cfe-dev mailing list