Index: lib/Sema/Sema.cpp =================================================================== --- lib/Sema/Sema.cpp +++ lib/Sema/Sema.cpp @@ -542,6 +542,9 @@ // __attribute__((weakref)) is basically a definition. if (ND->hasAttr()) continue; + if (isa(ND)) + continue; + if (FunctionDecl *FD = dyn_cast(ND)) { if (FD->isDefined()) continue; Index: test/SemaCXX/cxx1z-class-template-argument-deduction.cpp =================================================================== --- test/SemaCXX/cxx1z-class-template-argument-deduction.cpp +++ test/SemaCXX/cxx1z-class-template-argument-deduction.cpp @@ -1,4 +1,11 @@ -// RUN: %clang_cc1 -std=c++1z -verify %s +// RUN: %clang_cc1 -std=c++1z -verify %s -DTEST1 +// RUN: %clang_cc1 -std=c++1z -verify %s -DTEST2 + +// This test file has been split into two parts, +// the former which is checking for expected diagnostics +// and the latter, which does not expect any diagnostics. + +#if defined(TEST1) namespace std { using size_t = decltype(sizeof(0)); @@ -280,3 +287,17 @@ scoped_lock l = {}; } } + +#elif defined(TEST2) + +// expected-no-diagnostics +namespace undefined_warnings { + template + struct TemplDObj { + explicit TemplDObj(T func) noexcept {} + }; + + auto test = TemplDObj([] {}); +} + +#endif