Commit 80ca43a3 by Jason Merrill Committed by Jason Merrill

pt.c (type_unification_real): Set input_location during default arg instantiation.

	* pt.c (type_unification_real): Set input_location
	during default arg instantiation.

From-SVN: r181546
parent 6a4b4d31
2011-11-20 Jason Merrill <jason@redhat.com>
* pt.c (type_unification_real): Set input_location
during default arg instantiation.
2011-11-20 Paolo Carlini <paolo.carlini@oracle.com> 2011-11-20 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51230 PR c++/51230
......
...@@ -15218,9 +15218,13 @@ type_unification_real (tree tparms, ...@@ -15218,9 +15218,13 @@ type_unification_real (tree tparms,
{ {
tree parm = TREE_VALUE (TREE_VEC_ELT (tparms, i)); tree parm = TREE_VALUE (TREE_VEC_ELT (tparms, i));
tree arg = TREE_PURPOSE (TREE_VEC_ELT (tparms, i)); tree arg = TREE_PURPOSE (TREE_VEC_ELT (tparms, i));
location_t save_loc = input_location;
if (DECL_P (parm))
input_location = DECL_SOURCE_LOCATION (parm);
arg = tsubst_template_arg (arg, targs, complain, NULL_TREE); arg = tsubst_template_arg (arg, targs, complain, NULL_TREE);
arg = convert_template_argument (parm, arg, targs, complain, arg = convert_template_argument (parm, arg, targs, complain,
i, NULL_TREE); i, NULL_TREE);
input_location = save_loc;
if (arg == error_mark_node) if (arg == error_mark_node)
return 1; return 1;
else else
......
2011-11-20 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/sfinae11.C: Adjust.
* g++.dg/cpp0x/sfinae26.C: Adjust.
* g++.dg/template/unify11.C: Adjust.
2011-11-20 Paolo Carlini <paolo.carlini@oracle.com> 2011-11-20 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51230 PR c++/51230
......
...@@ -12,7 +12,8 @@ inline void f1( T& x ) noexcept( noexcept( declval<T&>().foo() ) ) // { dg-error ...@@ -12,7 +12,8 @@ inline void f1( T& x ) noexcept( noexcept( declval<T&>().foo() ) ) // { dg-error
} }
template< class T, template< class T,
bool Noexcept = noexcept( declval<T&>().foo() ) bool Noexcept = noexcept( declval<T&>().foo() ) // { dg-error "no member|not convert" }
> >
inline void f2( T& x ) noexcept( Noexcept ) inline void f2( T& x ) noexcept( Noexcept )
{ {
...@@ -51,7 +52,6 @@ int main() ...@@ -51,7 +52,6 @@ int main()
// static_assert( noexcept( f3(y) ), "shall be ill-formed(OK)." ); // static_assert( noexcept( f3(y) ), "shall be ill-formed(OK)." );
noexcept( f1(z) ); // { dg-message "required" } noexcept( f1(z) ); // { dg-message "required" }
static_assert( noexcept( f2(z) ), "shall be ill-formed." ); // { dg-error "no match|could not convert" } static_assert( noexcept( f2(z) ), "shall be ill-formed." ); // { dg-error "no match" }
// { dg-error "no member" "" { target *-*-* } 54 }
noexcept( f3(z) ); // { dg-message "required" } noexcept( f3(z) ); // { dg-message "required" }
} }
...@@ -6,9 +6,10 @@ struct A ...@@ -6,9 +6,10 @@ struct A
{ {
}; };
template <typename S, typename T, typename U, typename S::v = &S::v::s> template <typename S, typename T, typename U,
typename S::v = &S::v::s> // { dg-error "is not a" }
typename S::A typename S::A
foo (S c, T t, U u) // { dg-message "note" } foo (S c, T t, U u)
{ {
} }
...@@ -20,8 +21,7 @@ struct B ...@@ -20,8 +21,7 @@ struct B
C (U t) C (U t)
{ {
A a; A a;
A b = foo (this, a, t); // { dg-error "(no matching function|is not a)" } A b = foo (this, a, t); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 23 }
} }
} c; } c;
B () : c (A ()) B () : c (A ())
......
2011-11-20 Jason Merrill <jason@redhat.com>
* testsuite/20_util/bind/ref_neg.cc: Adjust error markings.
2011-11-20 Jonathan Wakely <jwakely.gcc@gmail.com> 2011-11-20 Jonathan Wakely <jwakely.gcc@gmail.com>
* include/backward/binders.h: Fix examples in doxygen comments and * include/backward/binders.h: Fix examples in doxygen comments and
......
...@@ -29,8 +29,12 @@ int inc(int& i) { return ++i; } ...@@ -29,8 +29,12 @@ int inc(int& i) { return ++i; }
void test01() void test01()
{ {
const int dummy = 0; const int dummy = 0;
std::bind(&inc, _1)(0); // { dg-error "no match|rvalue" } std::bind(&inc, _1)(0); // { dg-error "no match" }
std::bind(&inc, std::ref(dummy))(); // { dg-error "no match|const" } // { dg-error "rvalue|const" "" { target *-*-* } 1199 }
// { dg-error "rvalue|const" "" { target *-*-* } 1212 }
// { dg-error "rvalue|const" "" { target *-*-* } 1226 }
// { dg-error "rvalue|const" "" { target *-*-* } 1240 }
std::bind(&inc, std::ref(dummy))(); // { dg-error "no match" }
} }
struct Inc struct Inc
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment