https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83950
Jason Merrill <jason at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |WAITING --- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> --- (In reply to Sunil Pandey from comment #0) > This bug appear during latest HHVM build with GCC 8. GCC 7 works fine. > > $ cat AsyncLog.cpp > template <typename a, a b> struct c { static constexpr a d = b; }; > template <typename> struct e : c<bool, false> {}; > template <int, typename a = void> struct f { typedef a h; }; > typedef int size_t; > namespace folly { > struct dynamic { > template <class, class = void> struct g; > dynamic(char *); > template <class k, class = typename g<k>::h> dynamic(k); > void at(dynamic) const; > const dynamic *j(dynamic); > }; > template <class k> struct dynamic::g<k, typename f<e<k>::d>::h> { > using h = long; > }; > } > template <class> class l; > struct m { > folly::dynamic json; > }; > template <class n> class G : l<typename n::o> { const int &p(); }; > template <class n> const int &G<n>::p() { > m jpool; > auto json = jpool.json; > try { > auto jservers = json.j(""); > for (size_t i;;) > jservers->at(i); > } catch (int) { > } > } > > > $ g++ --version > g++ (GCC) 8.0.1 20180119 (experimental) > Copyright (C) 2018 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > > $ g++ -O3 -c AsyncLog.cpp -w > AsyncLog.cpp: In member function ‘const int& G<n>::p()’: > AsyncLog.cpp:28:21: error: no matching function for call to > ‘folly::dynamic::at(size_t&) const’ > jservers->at(i); > ^ > AsyncLog.cpp:10:8: note: candidate: ‘void folly::dynamic::at(folly::dynamic) > const’ > void at(dynamic) const; > ^~ > AsyncLog.cpp:10:8: note: no known conversion for argument 1 from ‘size_t’ > {aka ‘int’} to ‘folly::dynamic’ What's the bug? That error looks correct to me.