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

            Bug ID: 41201
           Summary: delete on atomic pointer is ambiguous
           Product: clang
           Version: 8.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangb...@nondot.org
          Reporter: bugzi...@poradnik-webmastera.com
                CC: blitzrak...@gmail.com, dgre...@apple.com,
                    erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
                    richard-l...@metafoo.co.uk

[code]
#include <atomic>

void test()
{
    delete std::atomic<int*>();
}
[/code]

Result of compilation with -O3 -std=c++11 is below. gcc does not complain on
this code.

[out]
<source>:5:5: error: ambiguous conversion of delete expression of type
'std::atomic<int *>' to a pointer

    delete std::atomic<int*>();

    ^      ~~~~~~~~~~~~~~~~~~~

/opt/compiler-explorer/gcc-8.3.0/lib/gcc/x86_64-linux-gnu/8.3.0/../../../../include/c++/8.3.0/atomic:366:7:
note: conversion to pointer type 'std::atomic<int *>::__pointer_type' (aka 'int
*')

      operator __pointer_type() const noexcept

      ^

/opt/compiler-explorer/gcc-8.3.0/lib/gcc/x86_64-linux-gnu/8.3.0/../../../../include/c++/8.3.0/atomic:369:7:
note: conversion to pointer type 'std::atomic<int *>::__pointer_type' (aka 'int
*')

      operator __pointer_type() const volatile noexcept
[/out]

-- 
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