From 0e32c5283ae8307179da18ddeef112435bbcbf6b Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 25 Mar 2016 22:29:27 +0000 Subject: Don't warn on "use" of undefined inline function that isn't actually an ODR use. In order for this to fire, the function needed to be a templated function marked 'constexpr' and declared but not defined. This weird pattern appears in libstdc++'s alloc_traits.h. llvm-svn: 264471 --- clang/test/SemaCXX/undefined-inline.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'clang/test/SemaCXX/undefined-inline.cpp') diff --git a/clang/test/SemaCXX/undefined-inline.cpp b/clang/test/SemaCXX/undefined-inline.cpp index 18973ef8b79..feb12f4552c 100644 --- a/clang/test/SemaCXX/undefined-inline.cpp +++ b/clang/test/SemaCXX/undefined-inline.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -triple i686-pc-win32 -verify %s +// RUN: %clang_cc1 -fsyntax-only -triple i686-pc-win32 -verify -std=c++11 %s // PR14993 namespace test1 { @@ -61,3 +61,8 @@ namespace test11 { inline void bar() __attribute__((dllimport)); void test() { foo(); bar(); } } + +namespace test12 { + template constexpr int _S_chk(int *); + decltype(_S_chk(nullptr)) n; +} -- cgit v1.2.3