From: jason Date: Fri, 20 Jun 2014 18:31:53 +0000 (+0000) Subject: PR c++/61556 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2a08bfb628f1d8ae4683483157c554d0ca013c4e;p=thirdparty%2Fgcc.git PR c++/61556 * call.c (build_over_call): Call build_this in template path. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211853 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a992c87de858..b4379542510f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2014-06-20 Jason Merrill + + PR c++/61556 + * call.c (build_over_call): Call build_this in template path. + 2014-06-19 Jason Merrill PR c++/59296 diff --git a/gcc/cp/call.c b/gcc/cp/call.c index e147abdd0831..da9143300496 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -6896,7 +6896,7 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain) ++nargs; alcarray = XALLOCAVEC (tree, nargs); - alcarray[0] = first_arg; + alcarray[0] = build_this (first_arg); FOR_EACH_VEC_SAFE_ELT (args, ix, arg) alcarray[ix + 1] = arg; argarray = alcarray; diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-template7.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-template7.C new file mode 100644 index 000000000000..e835dbf4db74 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-template7.C @@ -0,0 +1,32 @@ +// PR c++/61556 +// { dg-do compile { target c++11 } } + +class ValueType { +public: + constexpr operator int() const {return m_ID;}; + constexpr ValueType(const int v) + : m_ID(v) {} +private: + int m_ID; +}; + +class ValueTypeEnum { +public: + static constexpr ValueType doubleval = ValueType(1); +}; + +template +class ValueTypeInfo { +}; + +template +class FillFunctor { +public: + FillFunctor() { + ValueTypeInfo v; + } +}; + +int main() { + ValueTypeInfo v; +}