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

            Bug ID: 48281
           Summary: defaulted operator<=> triggers
                    -Wzero-as-null-pointer-constant
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++2a
          Assignee: unassignedclangb...@nondot.org
          Reporter: georg.sch...@emocean.io
                CC: blitzrak...@gmail.com, erik.pilking...@gmail.com,
                    llvm-bugs@lists.llvm.org, richard-l...@metafoo.co.uk

Created attachment 24201
  --> https://bugs.llvm.org/attachment.cgi?id=24201&action=edit
Compile using "clang++ -std=c++20"

Comparing two objects of a class or strut using <, >, <=, or >= results in the
warning "zero as null pointer constant" if the class has a defaulted
operator<=> (either friend or member).

To reproduce, compile the attached file with "clang++ -std=c++20"

Tested on Ubuntu 20.04 on WSL, using clang-11 package from
http://apt.llvm.org/focal/:

> clang++ -version
Ubuntu clang version
11.0.1-++20201121072613+973b95e0a84-1~exp1~20201121063226.132
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to