This makes Clang's constant expression evaluator and its IR generation disagree 
about the value of `__builtin_constant_p`. That seems dangerous to me, so I'd 
like to understand the justification for this a bit better. Random example of 
why this is dangerous:

  int f(int n) {
    if (!__builtin_constant_p(n))
      return 0;
  }
  int k = f(0);

Here, we'll suppress the `-Wreturn-type` warning because the frontend believes 
that it's impossible to reach the `}` of `f`. But when we generate IR, we'll 
fall off the function and experience nasal demons.

What's the motivation behind this change?

http://reviews.llvm.org/D4492



_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to