[PATCH] D92936: [Sema] Fix deleted function problem in implicitly movable test

dmajor via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 4 11:50:25 PST 2021


dmajor added a comment.

Before the revert, our bots hit the following issue where we only error out when `-Wall` is given, so there's definitely something strange going on. Also happens with @Quuxplusone's suggested change applied.

  $ cat test.cpp
  template < class > class RefPtr {
  public:
    ~RefPtr();
    template < typename d > RefPtr(d);
    operator int() &;
    operator int() && = delete;
  };
  class X;
  bool e() {
    RefPtr< X > frame(0);
    return frame;
  }
  
  $ clang -cc1 -std=c++17 test.cpp
  $ clang -cc1 -std=c++17 test.cpp -Wall
  test.cpp:11:10: error: conversion function from 'RefPtr<X>' to 'bool' invokes a deleted function
    return frame;
           ^~~~~
  test.cpp:6:3: note: 'operator int' has been explicitly marked deleted here
    operator int() && = delete;
    ^
  1 error generated.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92936/new/

https://reviews.llvm.org/D92936



More information about the cfe-commits mailing list