diff options
author | Serge Pavlov <sepavloff@gmail.com> | 2016-04-19 06:19:52 +0000 |
---|---|---|
committer | Serge Pavlov <sepavloff@gmail.com> | 2016-04-19 06:19:52 +0000 |
commit | e7d59be72fa9bc8435da45f4e98c6048b1ffa661 (patch) | |
tree | cc4e3b79e05554ac46826bd3e82022215c2c5f49 /test/SemaCXX/undefined-internal.cpp | |
parent | 52a9fbe3d8fdd8cb22ef6d23c1b92b5e83abba29 (diff) | |
download | clang-e7d59be72fa9bc8435da45f4e98c6048b1ffa661.tar.gz |
Warn if function or variable cannot be implicitly instantiated
With this patch compiler emits warning if it tries to make implicit instantiation
of a template but cannot find the template definition. The warning can be suppressed
by explicit instantiation declaration or by command line options
-Wundefined-var-template and -Wundefined-func-template. The implementation follows
the discussion of http://reviews.llvm.org/D12326.
Differential Revision: http://reviews.llvm.org/D16396
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266719 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/undefined-internal.cpp')
-rw-r--r-- | test/SemaCXX/undefined-internal.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/SemaCXX/undefined-internal.cpp b/test/SemaCXX/undefined-internal.cpp index 29ca5de6d4..59e6fdf9af 100644 --- a/test/SemaCXX/undefined-internal.cpp +++ b/test/SemaCXX/undefined-internal.cpp @@ -82,6 +82,7 @@ namespace test5 { static int var; // expected-warning {{variable 'test5::B<test5::(anonymous namespace)::A>::var' has internal linkage but is not defined}} static void foo(); // expected-warning {{function 'test5::B<test5::(anonymous namespace)::A>::foo' has internal linkage but is not defined}} }; + extern template int B<A>::var; void test() { B<A>::var = 0; // expected-note {{used here}} |