mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-24 03:14:08 +08:00
re PR c++/50848 (ICE in derived template class missing using for member of template base class)
PR c++/50848 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Don't crash if lookup finds a non-function. From-SVN: r181143
This commit is contained in:
parent
029ac5f967
commit
7e72c65d18
@ -1,5 +1,9 @@
|
||||
2011-11-07 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/50848
|
||||
* pt.c (tsubst_copy_and_build) [CALL_EXPR]: Don't crash
|
||||
if lookup finds a non-function.
|
||||
|
||||
PR c++/50863
|
||||
* parser.c (cp_parser_initializer_list): Parse C99
|
||||
array designators tentatively.
|
||||
|
@ -13673,6 +13673,8 @@ tsubst_copy_and_build (tree t,
|
||||
if (unq != function)
|
||||
{
|
||||
tree fn = unq;
|
||||
if (TREE_CODE (fn) == INDIRECT_REF)
|
||||
fn = TREE_OPERAND (fn, 0);
|
||||
if (TREE_CODE (fn) == COMPONENT_REF)
|
||||
fn = TREE_OPERAND (fn, 1);
|
||||
if (is_overloaded_fn (fn))
|
||||
@ -13682,7 +13684,9 @@ tsubst_copy_and_build (tree t,
|
||||
"and no declarations were found by "
|
||||
"argument-dependent lookup at the point "
|
||||
"of instantiation", function);
|
||||
if (DECL_CLASS_SCOPE_P (fn))
|
||||
if (!DECL_P (fn))
|
||||
/* Can't say anything more. */;
|
||||
else if (DECL_CLASS_SCOPE_P (fn))
|
||||
{
|
||||
inform (EXPR_LOC_OR_HERE (t),
|
||||
"declarations in dependent base %qT are "
|
||||
|
@ -1,5 +1,8 @@
|
||||
2011-11-07 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/50848
|
||||
* g++.dg/template/lookup9.C: New.
|
||||
|
||||
PR c++/50863
|
||||
* g++.dg/cpp0x/lambda/lambda-initlist1.C: New.
|
||||
|
||||
|
10
gcc/testsuite/g++.dg/template/lookup9.C
Normal file
10
gcc/testsuite/g++.dg/template/lookup9.C
Normal file
@ -0,0 +1,10 @@
|
||||
// PR c++/50848
|
||||
// { dg-options "-fpermissive" }
|
||||
|
||||
template<class T> class A {T& foo;};
|
||||
template<class T> class B: public A<T> {
|
||||
void f(){
|
||||
foo(1); // { dg-message "foo" }
|
||||
}
|
||||
};
|
||||
template class B<int>;
|
Loading…
Reference in New Issue
Block a user