[Lldb-commits] [lldb] 8cb7574 - Revert "[lldb] Enable C++14 when evaluating expressions in a C++14 frame"

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Fri May 22 12:23:44 PDT 2020


Author: Raphael Isemann
Date: 2020-05-22T21:23:03+02:00
New Revision: 8cb75745412e4bc9592d2409cc6cfa4a2940d9e7

URL: https://github.com/llvm/llvm-project/commit/8cb75745412e4bc9592d2409cc6cfa4a2940d9e7
DIFF: https://github.com/llvm/llvm-project/commit/8cb75745412e4bc9592d2409cc6cfa4a2940d9e7.diff

LOG: Revert "[lldb] Enable C++14 when evaluating expressions in a C++14 frame"

This reverts commit 5f88f39ab8154682c3b1eb9d7050a9412a55d9e7. It broke these
three tests on the Window bot:
  lldb-api :: commands/expression/completion/TestExprCompletion.py
  lldb-api :: lang/cpp/scope/TestCppScope.py
  lldb-api :: lang/cpp/standards/cpp11/TestCPP11Standard.py

Added: 
    

Modified: 
    lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp

Removed: 
    lldb/test/API/lang/cpp/standards/cpp11/Makefile
    lldb/test/API/lang/cpp/standards/cpp11/TestCPP11Standard.py
    lldb/test/API/lang/cpp/standards/cpp11/main.cpp
    lldb/test/API/lang/cpp/standards/cpp14/Makefile
    lldb/test/API/lang/cpp/standards/cpp14/TestCPP14Standard.py
    lldb/test/API/lang/cpp/standards/cpp14/main.cpp


################################################################################
diff  --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
index 877d75cfec30..8885cbc85b2c 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
@@ -491,11 +491,9 @@ ClangExpressionParser::ClangExpressionParser(
     // be re-evaluated in the future.
     lang_opts.CPlusPlus11 = true;
     break;
-  case lldb::eLanguageTypeC_plus_plus_14:
-    lang_opts.CPlusPlus14 = true;
-    LLVM_FALLTHROUGH;
   case lldb::eLanguageTypeC_plus_plus:
   case lldb::eLanguageTypeC_plus_plus_11:
+  case lldb::eLanguageTypeC_plus_plus_14:
     lang_opts.CPlusPlus11 = true;
     m_compiler->getHeaderSearchOpts().UseLibcxx = true;
     LLVM_FALLTHROUGH;

diff  --git a/lldb/test/API/lang/cpp/standards/cpp11/Makefile b/lldb/test/API/lang/cpp/standards/cpp11/Makefile
deleted file mode 100644
index e78030cbf752..000000000000
--- a/lldb/test/API/lang/cpp/standards/cpp11/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-CXX_SOURCES := main.cpp
-CXXFLAGS_EXTRAS := -std=c++11
-
-include Makefile.rules

diff  --git a/lldb/test/API/lang/cpp/standards/cpp11/TestCPP11Standard.py b/lldb/test/API/lang/cpp/standards/cpp11/TestCPP11Standard.py
deleted file mode 100644
index e4162c09758f..000000000000
--- a/lldb/test/API/lang/cpp/standards/cpp11/TestCPP11Standard.py
+++ /dev/null
@@ -1,19 +0,0 @@
-import lldb
-from lldbsuite.test.decorators import *
-from lldbsuite.test.lldbtest import *
-from lldbsuite.test import lldbutil
-
-class TestCase(TestBase):
-
-    mydir = TestBase.compute_mydir(__file__)
-
-    def test(self):
-        self.build()
-        lldbutil.run_to_source_breakpoint(self, "// break here", lldb.SBFileSpec("main.cpp"))
-
-        # Run an expression that is valid in C++11 (as it uses nullptr).
-        self.expect_expr("nullptr == nullptr", result_type="bool", result_value="true")
-
-        # Run a expression that is not valid in C++11 (as it uses polymorphic
-        # lambdas from C++14).
-        self.expect("expr [](auto x) { return x; }(1)", error=True, substrs=["'auto' not allowed in lambda parameter"])

diff  --git a/lldb/test/API/lang/cpp/standards/cpp11/main.cpp b/lldb/test/API/lang/cpp/standards/cpp11/main.cpp
deleted file mode 100644
index ba45ee316cd4..000000000000
--- a/lldb/test/API/lang/cpp/standards/cpp11/main.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-int main() {
-  return 0; // break here
-}

diff  --git a/lldb/test/API/lang/cpp/standards/cpp14/Makefile b/lldb/test/API/lang/cpp/standards/cpp14/Makefile
deleted file mode 100644
index a27336ffd9ac..000000000000
--- a/lldb/test/API/lang/cpp/standards/cpp14/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-CXX_SOURCES := main.cpp
-CXXFLAGS_EXTRAS := -std=c++14
-
-include Makefile.rules

diff  --git a/lldb/test/API/lang/cpp/standards/cpp14/TestCPP14Standard.py b/lldb/test/API/lang/cpp/standards/cpp14/TestCPP14Standard.py
deleted file mode 100644
index 3422cf19b3d7..000000000000
--- a/lldb/test/API/lang/cpp/standards/cpp14/TestCPP14Standard.py
+++ /dev/null
@@ -1,19 +0,0 @@
-import lldb
-from lldbsuite.test.decorators import *
-from lldbsuite.test.lldbtest import *
-from lldbsuite.test import lldbutil
-
-class TestCase(TestBase):
-
-    mydir = TestBase.compute_mydir(__file__)
-
-    def test(self):
-        self.build()
-        lldbutil.run_to_source_breakpoint(self, "// break here", lldb.SBFileSpec("main.cpp"))
-
-        # Run an expression that is valid in C++11 (as it uses nullptr).
-        self.expect_expr("nullptr == nullptr", result_type="bool", result_value="true")
-
-        # Run a expression that is only valid in C++14 that (as it uses
-        # polymorphic lambdas).
-        self.expect_expr("[](auto x) { return x; }(1)", result_type="int", result_value="1")

diff  --git a/lldb/test/API/lang/cpp/standards/cpp14/main.cpp b/lldb/test/API/lang/cpp/standards/cpp14/main.cpp
deleted file mode 100644
index ba45ee316cd4..000000000000
--- a/lldb/test/API/lang/cpp/standards/cpp14/main.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-int main() {
-  return 0; // break here
-}


        


More information about the lldb-commits mailing list