[llvm-bugs] [Bug 41201] New: delete on atomic pointer is ambiguous

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Mar 22 06:47:14 PDT 2019


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: unassignedclangbugs at nondot.org
          Reporter: bugzilla at poradnik-webmastera.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190322/e269c6c3/attachment.html>


More information about the llvm-bugs mailing list