Commit 0fbf4384 by Paolo Carlini Committed by Paolo Carlini

re PR c++/58305 (Deprecation warning for class not raised when not assigning to a variable)

/cp
2013-09-03  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/58305
	* typeck2.c (build_functional_cast): Maybe warn_deprecated_use.

/testsuite
2013-09-03  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/58305
	* g++.dg/warn/deprecated-8.C: New.

From-SVN: r202242
parent 7bacbe5c
2013-09-03 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58305
* typeck2.c (build_functional_cast): Maybe warn_deprecated_use.
2013-09-03 Mike Stump <mikestump@comcast.net>
* Make-lang.in (cp/lambda.o): Add dependencies.
......
......@@ -1761,7 +1761,14 @@ build_functional_cast (tree exp, tree parms, tsubst_flags_t complain)
return error_mark_node;
if (TREE_CODE (exp) == TYPE_DECL)
type = TREE_TYPE (exp);
{
type = TREE_TYPE (exp);
if (complain & tf_warning
&& TREE_DEPRECATED (type)
&& DECL_ARTIFICIAL (exp))
warn_deprecated_use (type, NULL_TREE);
}
else
type = exp;
......
2013-09-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58305
* g++.dg/warn/deprecated-8.C: New.
2013-09-03 Jeff Law <law@redhat.com>
* tree-ssa/ssa-dom-thread-3.c: Update due to changes in debug
......
// PR c++/58305
class ToBeDeprecated {
} __attribute__ ((deprecated ("deprecated!")));
typedef ToBeDeprecated NotToBeDeprecated; // { dg-warning "'ToBeDeprecated' is deprecated" }
int main() {
ToBeDeprecated(); // { dg-warning "'ToBeDeprecated' is deprecated" }
ToBeDeprecated x; // { dg-warning "'ToBeDeprecated' is deprecated" }
NotToBeDeprecated();
NotToBeDeprecated y;
}
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