C++ Logo

STD-DISCUSSION

Advanced search

Subject: Re: Question about name lookup and class member?
From: Eric Suen (eric_suen_at_[hidden])
Date: 2021-06-07 03:30:56


  Does this apply to default template arguments? this cause some weird
bugs of compilers
        
#include <iostream>

struct A {
   template<int V = 1 + /*F<1>()*/> //no syntax error in MSVC
   int test() {
     return V;
   }

   template<int V>
   static constexpr int F() {
     return V;
   }
};

int main() {
   std::cout << A().test<1>();
   std::cout << A().test<>(); //error in MSVC
}

> This is an item in issue
> http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#325
> <http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#325> . A
> couple of community members created an openoffice document during C++11
> last-minute-fixes and this was on that list.
>


STD-DISCUSSION list run by std-discussion-owner@lists.isocpp.org

Older Archives on Google Groups