Index: clang/lib/AST/Interp/ByteCodeExprGen.cpp =================================================================== --- clang/lib/AST/Interp/ByteCodeExprGen.cpp +++ clang/lib/AST/Interp/ByteCodeExprGen.cpp @@ -1421,7 +1421,7 @@ if (!this->emitDupPtr(Initializer)) return false; - return this->VisitCallExpr(CE); + return this->visit(CE); } else if (const auto *DIE = dyn_cast(Initializer)) { return this->visitInitializer(DIE->getExpr()); } else if (const auto *CE = dyn_cast(Initializer)) { Index: clang/test/AST/Interp/constexpr-nqueens.cpp =================================================================== --- clang/test/AST/Interp/constexpr-nqueens.cpp +++ clang/test/AST/Interp/constexpr-nqueens.cpp @@ -52,7 +52,7 @@ return Row == N ? Board(0, true) : B.ok(Row, Col) ? tryBoard(buildBoardRecurse(N, Col + 1, B.addQueen(Row, Col)), // ref-note {{in call to '&Board()->addQueen(0, 0)}} \ - // expected-note {{in call to '&B.addQueen(Row, Col).B.addQueen(Row, Col)->addQueen(0, 0)}} + // expected-note {{in call to '&Board().Board()->addQueen(0, 0)}} N, Col, Row+1, B) : buildBoardScan(N, Col, Row + 1, B); } Index: clang/test/AST/Interp/records.cpp =================================================================== --- clang/test/AST/Interp/records.cpp +++ clang/test/AST/Interp/records.cpp @@ -98,12 +98,20 @@ int b; constexpr C() : a(100), b(200) {} + + constexpr C get() const { + return *this; + } }; constexpr C c; static_assert(c.a == 100, ""); static_assert(c.b == 200, ""); +constexpr C c2 = C().get(); +static_assert(c.a == 100, ""); +static_assert(c.b == 200, ""); + constexpr int getB() { C c; int &j = c.b; Index: clang/test/SemaCXX/constexpr-nqueens.cpp =================================================================== --- clang/test/SemaCXX/constexpr-nqueens.cpp +++ clang/test/SemaCXX/constexpr-nqueens.cpp @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -std=c++11 -fsyntax-only %s +// RUN: %clang_cc1 -std=c++11 -fsyntax-only -fexperimental-new-constant-interpreter %s typedef unsigned long uint64_t;