]> granicus.if.org Git - clang/commitdiff
clang -dumpversion returns 4.2.1 for legacy reason, update it
authorSylvestre Ledru <sylvestre@debian.org>
Mon, 25 Mar 2019 18:06:20 +0000 (18:06 +0000)
committerSylvestre Ledru <sylvestre@debian.org>
Mon, 25 Mar 2019 18:06:20 +0000 (18:06 +0000)
Summary:
It has been introduced in 2011 for gcc compat:
https://github.com/llvm-mirror/clang/commit/95a907fc0f2f717dca38a379c1d2353bfea06d4f
it is probably time to remove it to remove the confusion.

reported: https://bugs.llvm.org/show_bug.cgi?id=38836
https://bugs.launchpad.net/ubuntu/+source/llvm-defaults/+bug/1810860

Reviewers: ddunbar, rnk

Reviewed By: rnk

Subscribers: jdoerfert, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D56803

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356931 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Driver.cpp
test/Driver/immediate-options.c

index de6a67bd6e1b4941b86016f9328e0fd9f7de1153..954c42ef9bf1258a65f8ff7378948fcda444d182 100644 (file)
@@ -1640,11 +1640,7 @@ bool Driver::HandleImmediateArgs(const Compilation &C) {
   if (C.getArgs().hasArg(options::OPT_dumpversion)) {
     // Since -dumpversion is only implemented for pedantic GCC compatibility, we
     // return an answer which matches our definition of __VERSION__.
-    //
-    // If we want to return a more correct answer some day, then we should
-    // introduce a non-pedantically GCC compatible mode to Clang in which we
-    // provide sensible definitions for -dumpversion, __VERSION__, etc.
-    llvm::outs() << "4.2.1\n";
+    llvm::outs() << CLANG_VERSION_STRING << "\n";
     return false;
   }
 
index 935c948321f55436a99bb0a0604304f8482a0b76..71494eec616f9162fe9044fa7e049958156b6849 100644 (file)
@@ -7,7 +7,7 @@
 // HELP-HIDDEN: driver-mode
 
 // RUN: %clang -dumpversion | FileCheck %s -check-prefix=DUMPVERSION
-// DUMPVERSION: 4.2.1
+// DUMPVERSION: {{[0-9]+\.[0-9.]+}}
 
 // RUN: %clang -print-search-dirs | FileCheck %s -check-prefix=PRINT-SEARCH-DIRS
 // PRINT-SEARCH-DIRS: programs: ={{.*}}