From: Richard Smith Date: Fri, 14 Oct 2011 00:34:28 +0000 (+0000) Subject: Add support for -std=gnu90 and -std=c++03, for compatibility with modern gcc. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=78f0ea710875425d501a4736565b3a34cf1840c8;p=clang Add support for -std=gnu90 and -std=c++03, for compatibility with modern gcc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141922 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Frontend/LangStandards.def b/include/clang/Frontend/LangStandards.def index 22229b2916..c82290b20d 100644 --- a/include/clang/Frontend/LangStandards.def +++ b/include/clang/Frontend/LangStandards.def @@ -37,6 +37,9 @@ LANGSTANDARD(c94, "iso9899:199409", LANGSTANDARD(gnu89, "gnu89", "ISO C 1990 with GNU extensions", BCPLComment | C89 | Digraphs | GNUMode | ImplicitInt) +LANGSTANDARD(gnu90, "gnu90", + "ISO C 1990 with GNU extensions", + BCPLComment | C89 | Digraphs | GNUMode | ImplicitInt) // C99-ish modes LANGSTANDARD(c99, "c99", @@ -75,8 +78,11 @@ LANGSTANDARD(gnu1x, "gnu1x", LANGSTANDARD(cxx98, "c++98", "ISO C++ 1998 with amendments", BCPLComment | CPlusPlus | Digraphs) +LANGSTANDARD(cxx03, "c++03", + "ISO C++ 1998 with amendments", + BCPLComment | CPlusPlus | Digraphs) LANGSTANDARD(gnucxx98, "gnu++98", - "ISO C++ 1998 with " "amendments and GNU extensions", + "ISO C++ 1998 with amendments and GNU extensions", BCPLComment | CPlusPlus | Digraphs | GNUMode) LANGSTANDARD(cxx0x, "c++0x", diff --git a/test/Driver/std.cpp b/test/Driver/std.cpp index 99deb11365..7704c8dda1 100644 --- a/test/Driver/std.cpp +++ b/test/Driver/std.cpp @@ -1,5 +1,6 @@ // RUN: %clang -std=c++98 %s -Wno-c++0x-compat -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX98 %s // RUN: %clang -std=gnu++98 %s -Wno-c++0x-compat -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX98 %s +// RUN: %clang -std=c++03 %s -Wno-c++0x-compat -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX98 %s // RUN: %clang -std=c++0x %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX11 %s // RUN: %clang -std=gnu++0x %s -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX11 %s // RUN: %clang -std=c++11 %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX11 %s