diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-04-23 09:27:53 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-04-23 09:27:53 +0000 |
commit | 61fbf6283816f4d9b8539cdc17bc147ed596281e (patch) | |
tree | 3fe3d67bacee831737dab3065a0736e32ff5230d /clang/test/Driver/clang_f_opts.c | |
parent | 72e705ed942beed43ef6d00109a215baa2d3cd7d (diff) | |
download | bcm5719-llvm-61fbf6283816f4d9b8539cdc17bc147ed596281e.tar.gz bcm5719-llvm-61fbf6283816f4d9b8539cdc17bc147ed596281e.zip |
Fix Clang's __DEPRECATED define to be controled by -Wdeprecated. This
matches GCC behavior which libstdc++ uses to limit #warning-based
messages about deprecation.
The machinery involves threading this through a new '-fdeprecated-macro'
flag for CC1. The flag defaults to "on", similarly to -Wdeprecated. We
turn the flag off in the driver when the warning is turned off (modulo
matching some GCC bugs). We record this as a language option, and key
the preprocessor on the option when introducing the define.
A separate flag rather than a '-D' flag allows us to properly represent
the difference between C and C++ builds (only C++ receives the define),
and it allows the specific behavior of following -Wdeprecated without
potentially impacting the set of user-provided macro flags.
llvm-svn: 130055
Diffstat (limited to 'clang/test/Driver/clang_f_opts.c')
-rw-r--r-- | clang/test/Driver/clang_f_opts.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/Driver/clang_f_opts.c b/clang/test/Driver/clang_f_opts.c index 8d63ca8706e..98952e60c1f 100644 --- a/clang/test/Driver/clang_f_opts.c +++ b/clang/test/Driver/clang_f_opts.c @@ -19,3 +19,11 @@ // WRITE-STRINGS2-NOT: -fconst-strings // RUN: %clang -### -S -Wwrite-strings -w %s 2>&1 | FileCheck -check-prefix=WRITE-STRINGS3 %s // WRITE-STRINGS3: -fconst-strings + +// RUN: %clang -### -c %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s +// RUN: %clang -### -c -Wdeprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s +// RUN: %clang -### -c -Wno-deprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-OFF-CHECK %s +// RUN: %clang -### -c -Wno-deprecated -Wdeprecated %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s +// RUN: %clang -### -c -w %s 2>&1 | FileCheck -check-prefix=DEPRECATED-ON-CHECK %s +// DEPRECATED-OFF-CHECK: -fno-deprecated-macro +// DEPRECATED-ON-CHECK-NOT: -fno-deprecated-macro |