[llvm-bugs] [Bug 31934] New: Functions with non-tautological enable_if conditions shouldn't be assignable to references

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Feb 10 13:12:36 PST 2017


https://llvm.org/bugs/show_bug.cgi?id=31934

            Bug ID: 31934
           Summary: Functions with non-tautological enable_if conditions
                    shouldn't be assignable to references
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: george.burgess.iv at gmail.com
          Reporter: george.burgess.iv at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

This behavior is good:

$ echo 'void foo(void) __attribute__((enable_if(false, ""))); void (*f)(void) =
foo;' | $clangpp -x c++ -o/dev/null -

error: cannot take address of function 'foo' because it has one or more
non-tautological enable_if conditions
$


This behavior is bad:

$ echo 'void foo(void) __attribute__((enable_if(false, ""))); void (&f)(void) =
foo;' | $clangpp -x c++ -o/dev/null -

$


...The difference being that we use *f in the good example, but &f in the bad.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170210/3541854e/attachment-0001.html>


More information about the llvm-bugs mailing list