PR c++/85866 - error with .* in default template arg.
* pt.c (tsubst_copy_and_build): Handle partial instantiation. From-SVN: r260562
This commit is contained in:
parent
720820185f
commit
0d2e69cb3c
@ -1,3 +1,8 @@
|
||||
2018-05-22 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/85866 - error with .* in default template arg.
|
||||
* pt.c (tsubst_copy_and_build): Handle partial instantiation.
|
||||
|
||||
2018-05-21 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
* parser.c (cp_parser_parameter_declaration_list): Remove
|
||||
|
@ -18433,7 +18433,9 @@ tsubst_copy_and_build (tree t,
|
||||
/* Unsupported internal function with arguments. */
|
||||
gcc_unreachable ();
|
||||
}
|
||||
else if (TREE_CODE (function) == OFFSET_REF)
|
||||
else if (TREE_CODE (function) == OFFSET_REF
|
||||
|| TREE_CODE (function) == DOTSTAR_EXPR
|
||||
|| TREE_CODE (function) == MEMBER_REF)
|
||||
ret = build_offset_ref_call_from_tree (function, &call_args,
|
||||
complain);
|
||||
else if (TREE_CODE (function) == COMPONENT_REF)
|
||||
|
29
gcc/testsuite/g++.dg/cpp0x/fntmpdefarg9.C
Normal file
29
gcc/testsuite/g++.dg/cpp0x/fntmpdefarg9.C
Normal file
@ -0,0 +1,29 @@
|
||||
// PR c++/85866
|
||||
// { dg-do compile { target c++11 } }
|
||||
|
||||
template<typename _Tp, typename _Up = _Tp&&>
|
||||
_Up
|
||||
__declval(int);
|
||||
|
||||
template<typename _Tp>
|
||||
_Tp
|
||||
__declval(long);
|
||||
|
||||
template<typename _Tp>
|
||||
auto declval() noexcept -> decltype(__declval<_Tp>(0));
|
||||
|
||||
template<typename...>
|
||||
using void_t = void;
|
||||
|
||||
template<typename U, typename V,
|
||||
void_t<decltype ( (declval<U>().*declval<V>()) () )
|
||||
>* = nullptr>
|
||||
void boom(){}
|
||||
|
||||
struct Foo {
|
||||
void bar(){}
|
||||
};
|
||||
|
||||
int main() {
|
||||
boom<Foo, decltype(&Foo::bar)>();
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user