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
This commit is contained in:
parent
7bacbe5c8a
commit
0fbf438441
|
@ -1,3 +1,8 @@
|
|||
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);
|
||||
|
||||
if (complain & tf_warning
|
||||
&& TREE_DEPRECATED (type)
|
||||
&& DECL_ARTIFICIAL (exp))
|
||||
warn_deprecated_use (type, NULL_TREE);
|
||||
}
|
||||
else
|
||||
type = exp;
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
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
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
// 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;
|
||||
}
|
Loading…
Reference in New Issue