Skip to content

Commit

Permalink
clang -dumpversion returns 4.2.1 for legacy reason, update it
Browse files Browse the repository at this point in the history
Summary:
It has been introduced in 2011 for gcc compat:
llvm-mirror/clang@95a907f
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

llvm-svn: 356931
  • Loading branch information
sylvestre committed Mar 25, 2019
1 parent f49e33e commit a199a9b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions clang/lib/Driver/Driver.cpp
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion clang/test/Driver/immediate-options.c
Expand Up @@ -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: ={{.*}}
Expand Down

0 comments on commit a199a9b

Please sign in to comment.