https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67941

            Bug ID: 67941
           Summary: calls on function pointer from a captureless lambda
                    cause ubsan warning
           Product: gcc
           Version: 5.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: blaffablaffa at gmail dot com
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org
  Target Milestone: ---

Test program: int main(){ (+[](){})(); }
Compilation: -std=c++11 -fsanitize=null
Wrong output: <stdin>:1:20: runtime error: member call on null pointer of type
'const struct __lambda0'
Expected: no warning at all.

Note: if the cast to a function pointer is not performed (remove the +), there
is no warning, probably because the capture is still used, although empty.

Reply via email to