C++ Logo

std-discussion

Advanced search

Re: Question about name lookup and class member?

From: Eric Suen <eric_suen_at_[hidden]>
Date: Tue, 8 Jun 2021 15:33:48 +0800
That's why I call it weird bug coz it's obvious. MSVC won't report any
error at that line with/without the comment.

Try https://godbolt.org/ if you don't have MSVC.

> (I assume you didn't mean to comment out the "F<1>()" expression, since
> "template<int V = 1 + >" is certainly a syntax error.)
>
> No, a default template argument is not a complete-class context
> ([class.mem]/6 <https://timsong-cpp.github.io/cppwp/n4861/class.mem#6>).
> Clang++ and g++ are correct to complain that "F" is not declared.
>
> -- Andrew Schepler
>

Received on 2021-06-08 02:34:02