diff options
author | Jason Merrill <jason@redhat.com> | 2011-11-20 21:04:38 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-11-20 21:04:38 -0500 |
commit | 80ca43a3140e5389e0b07621f9e30704f8371d20 (patch) | |
tree | 04c08061e821d1749a3b70b3445de464514be794 /gcc | |
parent | 6a4b4d31790e8af35c452689d967b94f0ce06b1a (diff) | |
download | gcc-80ca43a3140e5389e0b07621f9e30704f8371d20.zip gcc-80ca43a3140e5389e0b07621f9e30704f8371d20.tar.gz gcc-80ca43a3140e5389e0b07621f9e30704f8371d20.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/pt.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/sfinae11.C | 6 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/unify11.C | 8 |
5 files changed, 22 insertions, 7 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1bc0e5a..21bfbcd 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +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> PR c++/51230 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index f4eb1d4..5b39e9f 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -15218,9 +15218,13 @@ type_unification_real (tree tparms, { tree parm = TREE_VALUE (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 = convert_template_argument (parm, arg, targs, complain, i, NULL_TREE); + input_location = save_loc; if (arg == error_mark_node) return 1; else diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8b2f661..57ed126 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +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> PR c++/51230 diff --git a/gcc/testsuite/g++.dg/cpp0x/sfinae11.C b/gcc/testsuite/g++.dg/cpp0x/sfinae11.C index 25902cb..2e8408d 100644 --- a/gcc/testsuite/g++.dg/cpp0x/sfinae11.C +++ b/gcc/testsuite/g++.dg/cpp0x/sfinae11.C @@ -12,7 +12,8 @@ inline void f1( T& x ) noexcept( noexcept( declval<T&>().foo() ) ) // { dg-error } 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 ) { @@ -51,7 +52,6 @@ int main() // static_assert( noexcept( f3(y) ), "shall be ill-formed(OK)." ); noexcept( f1(z) ); // { dg-message "required" } - static_assert( noexcept( f2(z) ), "shall be ill-formed." ); // { dg-error "no match|could not convert" } - // { dg-error "no member" "" { target *-*-* } 54 } + static_assert( noexcept( f2(z) ), "shall be ill-formed." ); // { dg-error "no match" } noexcept( f3(z) ); // { dg-message "required" } } diff --git a/gcc/testsuite/g++.dg/template/unify11.C b/gcc/testsuite/g++.dg/template/unify11.C index 25606dc..85bdbbc 100644 --- a/gcc/testsuite/g++.dg/template/unify11.C +++ b/gcc/testsuite/g++.dg/template/unify11.C @@ -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 -foo (S c, T t, U u) // { dg-message "note" } +foo (S c, T t, U u) { } @@ -20,8 +21,7 @@ struct B C (U t) { A a; - A b = foo (this, a, t); // { dg-error "(no matching function|is not a)" } - // { dg-message "candidate" "candidate note" { target *-*-* } 23 } + A b = foo (this, a, t); // { dg-error "no matching function" } } } c; B () : c (A ()) |