diff options
author | George Burgess IV <george.burgess.iv@gmail.com> | 2015-10-12 19:57:04 +0000 |
---|---|---|
committer | George Burgess IV <george.burgess.iv@gmail.com> | 2015-10-12 19:57:04 +0000 |
commit | 5f21c718007fdc3b801690ef96908b43b8a1924e (patch) | |
tree | ec62116b246a319fd019f1f1545b620ec919cf3e /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 3320bcd81569bcf9dc73b02bfc6b08352ab4cf22 (diff) | |
download | llvm-5f21c718007fdc3b801690ef96908b43b8a1924e.zip llvm-5f21c718007fdc3b801690ef96908b43b8a1924e.tar.gz llvm-5f21c718007fdc3b801690ef96908b43b8a1924e.tar.bz2 |
[Sema] Make `&function_with_enable_if_attrs` an error
This fixes a bug where one can take the address of a conditionally
enabled function to drop its enable_if guards. For example:
int foo(int a) __attribute__((enable_if(a > 0, "")));
int (*p)(int) = &foo;
int result = p(-1); // compilation succeeds; calls foo(-1)
Overloading logic has been updated to reflect this change, as well.
Functions with enable_if attributes that are always true are still
allowed to have their address taken.
Differential Revision: http://reviews.llvm.org/D13607
llvm-svn: 250090
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions