|
When a function template (or member of a class template) is instantiated
by an implicit class member definition, Clang delays the instantiation
for later handling by clang::Sema::PerformPendingInstantiations during
clang::Sema::ActOnEndOfTranslationUnit. If the instantiation causes
errors they are not suppressed because our clang::Sema::SFINAETrap has
gone out of scope.
Even if we could keep a clang::Sema::SFINAETrap in scope, the
clang::Sema::InstantiatingTemplate::Initialize method sets
sema.InNonInstantiationSFINAEContext to false and adds an entry to
sema.ActiveTemplateInstantiations. This prevents the
clang::Sema::EmitCurrentDiagnostic call to isSFINAEContext from
returning a valid SFINAE context, so errors are still not suppressed.
Add a test case demonstrating this known failure, and mark it as
"broken". This will require changes to Clang to fix.
|