================ @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -fsyntax-only -Wunused-variable -Wunused-label -Wno-c++1y-extensions -verify %s -// RUN: %clang_cc1 -fsyntax-only -Wunused-variable -Wunused-label -Wno-c++1y-extensions -verify -std=gnu++11 %s +// RUN: %clang_cc1 -fsyntax-only -Wunused-variable -Wunused-label -Wno-c++1y-extensions -verify -std=gnu++17 %s ---------------- vinayakdsci wrote:
> OK, the difference in behaviour seems to stem from the fact that in C++-11 > mode and C++-14 mode, the constructors are marked as not > elidable(clang/lib/Sema/SemaDecl.cpp, line 2049). This causes it to return > false when these constructors which are created by copy initialization are > encountered, specifically while passing in C++ standard modes lower than > C++-17 This seems to be because Clang at the moment is not accepting converting constructors for copy elision at all! I found ``clang/lib/Sema/SemaDeclCXX.cpp, line 16042, Sema::BuildCXXConstructExpr()`` to be the culprit here. We currently assume that the constructor has the source object currently passed as the first argument. The function is annotated with FIXMEs. https://github.com/llvm/llvm-project/pull/81127 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits