summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/inline.cpp
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2012-06-18 23:58:49 +0000
committerJordan Rose <jordan_rose@apple.com>2012-06-18 23:58:49 +0000
commit8cea63c5cd15d7ef30fa3a1103ca5a6dd2715a36 (patch)
tree9c8c76b275d22e89808afe6dab5660c7bd750ad8 /clang/test/SemaCXX/inline.cpp
parentf9abcb7ba906baea9eac83bd60c251a96b3b9016 (diff)
downloadbcm5719-llvm-8cea63c5cd15d7ef30fa3a1103ca5a6dd2715a36.tar.gz
bcm5719-llvm-8cea63c5cd15d7ef30fa3a1103ca5a6dd2715a36.zip
Change -Winternal-linkage-in-inline from ExtWarn to Warning in C++.
Per post-commit review, it's not appropriate to use ExtWarn in C++, because we can't prove that the inline function will actually be defined in more than one place (and thus we can't prove that this violates the ODR). This removes the warning entirely from uses in the main source file in C++. llvm-svn: 158689
Diffstat (limited to 'clang/test/SemaCXX/inline.cpp')
-rw-r--r--clang/test/SemaCXX/inline.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/test/SemaCXX/inline.cpp b/clang/test/SemaCXX/inline.cpp
index 9ef0229c990..6f3570e3ca0 100644
--- a/clang/test/SemaCXX/inline.cpp
+++ b/clang/test/SemaCXX/inline.cpp
@@ -95,14 +95,14 @@ inline int useStaticMainFile () {
return staticVar; // no-warning
}
-// Check that the warnings show up when explicitly requested.
+// Check that the warnings don't show up even when explicitly requested in C++.
#pragma clang diagnostic push
#pragma clang diagnostic warning "-Winternal-linkage-in-inline"
-inline int useStaticAgain () { // expected-note 2 {{use 'static' to give inline function 'useStaticAgain' internal linkage}}
- anonFunction(); // expected-warning{{function 'anonFunction' is in an anonymous namespace but is used in an inline function with external linkage}}
- return staticVar; // expected-warning{{variable 'staticVar' has internal linkage but is used in an inline function with external linkage}}
+inline int useStaticAgain () {
+ anonFunction(); // no-warning
+ return staticVar; // no-warning
}
#pragma clang diagnostic pop
OpenPOWER on IntegriCloud