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,13 @@ -// 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 file has to be split into two tests because +// the former test contains expected diagnostics, +// whereas the second test should not produce any +// diagnostics (expected-no-diagnostics cannot +// be used with other expected- diagnostics checks). + +#if defined(TEST1) namespace std { using size_t = decltype(sizeof(0)); @@ -280,3 +289,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