diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2012-12-29 23:43:00 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2012-12-29 23:43:00 +0000 |
commit | 9f409549fa36f1a69042d4793321e82004dbfea9 (patch) | |
tree | de76dbcd232b50ff5ce4740dc13acb4e25baa6be /test/SemaCXX/undefined-internal.cpp | |
parent | 07cf58c96dc599d1c25dae4efd9445b6f5d3596c (diff) |
Don't warn for undefined but used decls that are external because of a typedef.
This fixes pr14736. It is fairly ugly, but I don't think we can do much better
as we have to wait at least until the end of the typedef to know if the
function will have external linkage or not.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171240 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/undefined-internal.cpp')
-rw-r--r-- | test/SemaCXX/undefined-internal.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/SemaCXX/undefined-internal.cpp b/test/SemaCXX/undefined-internal.cpp index 154172001e..e8ee4c1e90 100644 --- a/test/SemaCXX/undefined-internal.cpp +++ b/test/SemaCXX/undefined-internal.cpp @@ -181,3 +181,21 @@ namespace OverloadUse { template<void x(int)> void t(long*) { x(10); } // expected-note {{used here}} void g() { long a; t<f>(&a); } } + +namespace test7 { + typedef struct { + void bar(); + void foo() { + bar(); + } + } A; +} + +namespace test8 { + typedef struct { + void bar(); // expected-warning {{function 'test8::<anonymous struct>::bar' has internal linkage but is not defined}} + void foo() { + bar(); // expected-note {{used here}} + } + } *A; +} |