Commit 2de9164b by Paolo Carlini Committed by Paolo Carlini

re PR c++/77555 (unused inline function in-function static variable accessed…

re PR c++/77555 (unused inline function in-function static variable accessed from outside leads to linker error)

2017-10-23  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/77555
	* g++.dg/torture/pr77555.C: New.

From-SVN: r254006
parent 0524367e
2017-10-23 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/77555
* g++.dg/torture/pr77555.C: New.
2017-10-23 Richard Biener <rguenther@suse.de>
PR tree-optimization/82129
......
// { dg-do link }
// { dg-options "-std=c++11" }
extern "C" int printf(const char*, ...);
struct A {
A(int, char *p2) { printf(p2); }
};
template <int, typename> struct B { static A static_var; };
template <int LINE, typename GETTER>
A B<LINE, GETTER>::static_var{0, GETTER::get()};
struct C {
void unused() {
static char function_static;
struct D {
static char *get() { return &function_static; }
};
auto addr = B<0, D>::static_var;
}
};
int main() {}
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