mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-05 05:20:24 +08:00
Propagate the source location from a template function's definition to
any already-instantiated declarations. PR c++/46527 * gcc/cp/pt.c (instantiate_decl): Propagate the template's location to its instance. * gcc/testsuite/g++.dg/debug/dwarf2/pr46527.C: New test. From-SVN: r167104
This commit is contained in:
parent
9959d57239
commit
3862bc3a55
@ -1,3 +1,9 @@
|
||||
2010-11-23 Jeffrey Yasskin <jyasskin@google.com>
|
||||
|
||||
PR c++/46527
|
||||
* pt.c (instantiate_decl): Propagate the template's location to
|
||||
its instance.
|
||||
|
||||
2010-11-20 Joseph Myers <joseph@codesourcery.com>
|
||||
|
||||
* name-lookup.c (handle_namespace_attrs): Don't check
|
||||
|
@ -17152,6 +17152,8 @@ instantiate_decl (tree d, int defer_ok,
|
||||
&& !DECL_NOT_REALLY_EXTERN (d))
|
||||
mark_definable (d);
|
||||
|
||||
DECL_SOURCE_LOCATION (td) = DECL_SOURCE_LOCATION (code_pattern);
|
||||
DECL_SOURCE_LOCATION (d) = DECL_SOURCE_LOCATION (code_pattern);
|
||||
input_location = DECL_SOURCE_LOCATION (d);
|
||||
|
||||
/* If D is a member of an explicitly instantiated class template,
|
||||
|
@ -1,3 +1,8 @@
|
||||
2010-11-23 Jeffrey Yasskin <jyasskin@google.com>
|
||||
|
||||
PR c++/46527
|
||||
* g++.dg/debug/dwarf2/pr46527.C: New test.
|
||||
|
||||
2010-11-23 Iain Sandoe <iains@gcc.gnu.org>
|
||||
|
||||
* gcc.dg/darwin-cfstring-1.c: Adjust format messages.
|
||||
|
18
gcc/testsuite/g++.dg/debug/dwarf2/pr46527.C
Normal file
18
gcc/testsuite/g++.dg/debug/dwarf2/pr46527.C
Normal file
@ -0,0 +1,18 @@
|
||||
// Origin: PR 46527
|
||||
// { dg-do compile }
|
||||
// { dg-options "-g -O0 -dA" }
|
||||
|
||||
template <typename T> struct Struct {
|
||||
double defined_later();
|
||||
};
|
||||
struct WrapperStruct {
|
||||
Struct<double> ClassInstantiated;
|
||||
};
|
||||
template <typename T> double
|
||||
Struct<T>::defined_later() // { dg-function-on-line {_ZN6StructIdE13defined_laterEv} }
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
void InstantiateMethod() {
|
||||
Struct<double>().defined_later();
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user