llvm-project/clang/unittests
Hans Wennborg d2b9fc88c8 Revert r359949 "[clang] adding explicit(bool) from c++2a"
This caused Clang to start erroring on the following:

  struct S {
    template <typename = int> explicit S();
  };

  struct T : S {};

  struct U : T {
    U();
  };
  U::U() {}

  $ clang -c /tmp/x.cc
  /tmp/x.cc:10:4: error: call to implicitly-deleted default constructor of 'T'
  U::U() {}
     ^
  /tmp/x.cc:5:12: note: default constructor of 'T' is implicitly deleted
    because base class 'S' has no default constructor
  struct T : S {};
             ^
  1 error generated.

See discussion on the cfe-commits email thread.

This also reverts the follow-ups r359966 and r359968.

> this patch adds support for the explicit bool specifier.
>
> Changes:
> - The parsing for the explicit(bool) specifier was added in ParseDecl.cpp.
> - The storage of the explicit specifier was changed. the explicit specifier was stored as a boolean value in the FunctionDeclBitfields and in the DeclSpec class. now it is stored as a PointerIntPair<Expr*, 2> with a flag and a potential expression in CXXConstructorDecl, CXXDeductionGuideDecl, CXXConversionDecl and in the DeclSpec class.
> - Following the AST change, Serialization, ASTMatchers, ASTComparator and ASTPrinter were adapted.
> - Template instantiation was adapted to instantiate the potential expressions of the explicit(bool) specifier When instantiating their associated declaration.
> - The Add*Candidate functions were adapted, they now take a Boolean indicating if the context allowing explicit constructor or conversion function and this boolean is used to remove invalid overloads that required template instantiation to be detected.
> - Test for Semantic and Serialization were added.
>
> This patch is not yet complete. I still need to check that interaction with CTAD and deduction guides is correct. and add more tests for AST operations. But I wanted first feedback.
> Perhaps this patch should be spited in smaller patches, but making each patch testable as a standalone may be tricky.
>
> Patch by Tyker
>
> Differential Revision: https://reviews.llvm.org/D60934

llvm-svn: 360024
2019-05-06 09:51:10 +00:00
..
AST Revert r359949 "[clang] adding explicit(bool) from c++2a" 2019-05-06 09:51:10 +00:00
ASTMatchers Added an AST matcher for declarations that are in the `std` namespace 2019-05-03 12:50:00 +00:00
Analysis [analyzer] Treat functions without run-time branches as "small". 2019-04-30 03:01:02 +00:00
Basic [FileSystemStatCache] Update test for new FileSystemStatCache API 2019-04-16 18:00:43 +00:00
CodeGen Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CrossTU Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Driver [Driver] Support priority for multilibs 2019-04-27 00:25:11 +00:00
Format [clang-format] Fix bug in block comment reflow that joins * and / 2019-05-03 23:15:40 +00:00
Frontend Modules: Add LangOptions::CacheGeneratedPCH 2019-03-12 18:38:04 +00:00
Index [clang][Index] Fix msan failure 2019-03-08 10:18:40 +00:00
Lex [clang][HeaderSuggestion] Handle the case of dotdot with an absolute path 2019-04-24 09:23:31 +00:00
Rename Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Rewrite Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Sema [Testing] Move clangd::Annotations to llvm testing support 2019-04-25 10:08:31 +00:00
Serialization Stop relying on allocator behaviour in modules unit test 2019-03-09 20:15:01 +00:00
StaticAnalyzer Add header guard to Reusables.h [NFC] 2019-04-19 00:42:54 +00:00
Tooling [c++20] Implement P0428R2 - Familiar template syntax for generic lambdas 2019-05-04 10:49:46 +00:00
libclang Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CMakeLists.txt Modules: Rename MemoryBufferCache to InMemoryModuleCache 2019-03-09 17:33:56 +00:00