[PATCH] D28889: Change where we handle arg-dependent diagnose_if attributes

George Burgess IV via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 18 20:35:49 PST 2017


george.burgess.iv created this revision.

As it turns out, emitting diagnostics from places where you're not meant to emit them from is a very bad idea. :)

After some looking around, it seems that it's less insane to check for `diagnose_if` attributes in code that's already checking for e.g. nullness warnings. As a result, we get to rip out the `diagnose_if`-induced changes to overloading. Woohoo!

This also includes a slight change to how `diagnose_if` works: for "error" calls, we'll always assume that overload resolution chose the overload the user wanted. So, regardless of whetehr a `diagnose_if` attribute emits a diag or not, we'll continue building the AST/etc as usual.

This patch aims to fix PR31638, PR31639, and PR31640.


https://reviews.llvm.org/D28889

Files:
  include/clang/Sema/Overload.h
  include/clang/Sema/Sema.h
  lib/Sema/SemaChecking.cpp
  lib/Sema/SemaExpr.cpp
  lib/Sema/SemaExprCXX.cpp
  lib/Sema/SemaLookup.cpp
  lib/Sema/SemaOverload.cpp
  test/Sema/diagnose_if.c
  test/SemaCXX/diagnose_if.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28889.84928.patch
Type: text/x-patch
Size: 57244 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170119/0f44c561/attachment-0001.bin>


More information about the cfe-commits mailing list