Skip to content

Commit

Permalink
Merge pull request #3398 from masatake/c++--fix-invalid-test-input
Browse files Browse the repository at this point in the history
C++  fix invalid test input

Releated to #3388.
MERGING without getting a review by @pragmaware.
  • Loading branch information
masatake committed Jun 7, 2022
2 parents 80ee839 + 56ab8ff commit 227c65e
Show file tree
Hide file tree
Showing 16 changed files with 189 additions and 59 deletions.
1 change: 1 addition & 0 deletions Units/parser-cxx.r/instantiation.d/args.ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--sort=no
12 changes: 12 additions & 0 deletions Units/parser-cxx.r/instantiation.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
X input.hpp /^template <class T> struct X { };$/;" s
Y input.hpp /^template <int N> struct Y { };$/;" s
M input.hpp /^#define M /;" d
S input.hpp /^struct S {$/;" s
i input.hpp /^ int i;$/;" m struct:S typeref:typename:int
y input.hpp /^ Y<0> y;$/;" m struct:S typeref:typename:Y<0>
x0 input.hpp /^ X< Y< 1 > > x0;$/;" m struct:S typeref:typename:X<Y<1>>
x1 input.hpp /^ X< Y< 1 + 2 > > x1;$/;" m struct:S typeref:typename:X<Y<1+2>>
x2 input.hpp /^ X< Y< 1 << 2 > > x2;$/;" m struct:S typeref:typename:X<Y<1<<2>>
x3 input.hpp /^ X< Y< M << 2 > > x3;$/;" m struct:S typeref:typename:X<Y<M<<2>>
x4 input.hpp /^ X< Y< M << M > > x4;$/;" m struct:S typeref:typename:X<Y<M<<M>>
d input.hpp /^ double d;$/;" m struct:S typeref:typename:double
15 changes: 15 additions & 0 deletions Units/parser-cxx.r/instantiation.d/input.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Based on an example in https://cpplover.blogspot.com/2013/12/c03c11_3905.html (in Japanese)

template <class T> struct X { };
template <int N> struct Y { };
#define M 2
struct S {
int i;
Y<0> y;
X< Y< 1 > > x0;
X< Y< 1 + 2 > > x1;
X< Y< 1 << 2 > > x2;
X< Y< M << 2 > > x3;
X< Y< M << M > > x4;
double d;
};
1 change: 1 addition & 0 deletions Units/parser-cxx.r/instantiation.d/validator
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cxx11
1 change: 1 addition & 0 deletions Units/parser-cxx.r/instantiation2.b/args.ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--sort=no
12 changes: 12 additions & 0 deletions Units/parser-cxx.r/instantiation2.b/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
X input.hpp /^template <class T> struct X { };$/;" s
Y input.hpp /^template <int N> struct Y { };$/;" s
M input.hpp /^#define M /;" d
S input.hpp /^struct S {$/;" s
i input.hpp /^ int i;$/;" m struct:S typeref:typename:int
x2 input.hpp /^ X< Y< 1 >> 2 > > x2;$/;" m struct:S typeref:typename:X<Y<1>>2>>
x3 input.hpp /^ X< Y< M >> 2 > > x3;$/;" m struct:S typeref:typename:X<Y<M>>2>>
x4 input.hpp /^ X< Y< M >> M > > x4;$/;" m struct:S typeref:typename:X<Y<M>>M>>
x5 input.hpp /^ X< Y< 1 < 2 > > x5;$/;" m struct:S typeref:typename:X<Y<1<2>>
x6 input.hpp /^ X< Y< M < 2 > > x6;$/;" m struct:S typeref:typename:X<Y<M<2>>
x7 input.hpp /^ X< Y< M < M > > x7;$/;" m struct:S typeref:typename:X<Y<M<M>>
d input.hpp /^ double d;$/;" m struct:S typeref:typename:double
20 changes: 20 additions & 0 deletions Units/parser-cxx.r/instantiation2.b/input.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Based on an example in https://cpplover.blogspot.com/2013/12/c03c11_3905.html (in Japanese)
// A C++03 compiler may accepts this input but a C++11 compiler may not.
template <class T> struct X { };
template <int N> struct Y { };
#define M 2
struct S {
int i;
X< Y< 1 >> 2 > > x2;
X< Y< M >> 2 > > x3;
X< Y< M >> M > > x4;
X< Y< 1 < 2 > > x5;
X< Y< M < 2 > > x6;
X< Y< M < M > > x7;
/* Too ambiguous even in C++03
---------------------------
X< Y< 1 > 2 > > x8;
X< Y< M > 2 > > x9;
X< Y< M > M > > xa; */
double d;
};
1 change: 1 addition & 0 deletions Units/parser-cxx.r/instantiation2.b/validator
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cxx03
Original file line number Diff line number Diff line change
Expand Up @@ -23,48 +23,48 @@ funcC input-2.hpp /^template<typename T,int I,int J = I < V> K funcC(T t)$/;" f
T input-2.hpp /^template<typename T,int I,int J = I < V> K funcC(T t)$/;" Z function:funcC typeref:meta:typename
I input-2.hpp /^template<typename T,int I,int J = I < V> K funcC(T t)$/;" Z function:funcC typeref:typename:int
J input-2.hpp /^template<typename T,int I,int J = I < V> K funcC(T t)$/;" Z function:funcC typeref:typename:int
funcD input-2.hpp /^template<typename T,int I,int J = I >> 2> K funcD(T t)$/;" f typeref:typename:K template:<typename T,int I,int J=I>>2>
T input-2.hpp /^template<typename T,int I,int J = I >> 2> K funcD(T t)$/;" Z function:funcD typeref:meta:typename
I input-2.hpp /^template<typename T,int I,int J = I >> 2> K funcD(T t)$/;" Z function:funcD typeref:typename:int
J input-2.hpp /^template<typename T,int I,int J = I >> 2> K funcD(T t)$/;" Z function:funcD typeref:typename:int
funcE input-2.hpp /^template<typename T,int I,int J = 1 >> I> K funcE(T t)$/;" f typeref:typename:K template:<typename T,int I,int J=1>> I>
T input-2.hpp /^template<typename T,int I,int J = 1 >> I> K funcE(T t)$/;" Z function:funcE typeref:meta:typename
I input-2.hpp /^template<typename T,int I,int J = 1 >> I> K funcE(T t)$/;" Z function:funcE typeref:typename:int
J input-2.hpp /^template<typename T,int I,int J = 1 >> I> K funcE(T t)$/;" Z function:funcE typeref:typename:int
funcF input-2.hpp /^template<typename T,int I,int L,int J = I >> L> K funcF(T t)$/;" f typeref:typename:K template:<typename T,int I,int L,int J=I>> L>
T input-2.hpp /^template<typename T,int I,int L,int J = I >> L> K funcF(T t)$/;" Z function:funcF typeref:meta:typename
I input-2.hpp /^template<typename T,int I,int L,int J = I >> L> K funcF(T t)$/;" Z function:funcF typeref:typename:int
L input-2.hpp /^template<typename T,int I,int L,int J = I >> L> K funcF(T t)$/;" Z function:funcF typeref:typename:int
J input-2.hpp /^template<typename T,int I,int L,int J = I >> L> K funcF(T t)$/;" Z function:funcF typeref:typename:int
funcG input-2.hpp /^template<typename T,int I,int J = 1 >> V> K funcG(T t)$/;" f typeref:typename:K template:<typename T,int I,int J=1>> V>
T input-2.hpp /^template<typename T,int I,int J = 1 >> V> K funcG(T t)$/;" Z function:funcG typeref:meta:typename
I input-2.hpp /^template<typename T,int I,int J = 1 >> V> K funcG(T t)$/;" Z function:funcG typeref:typename:int
J input-2.hpp /^template<typename T,int I,int J = 1 >> V> K funcG(T t)$/;" Z function:funcG typeref:typename:int
funcH input-2.hpp /^template<typename T,int I,int J = I >> V> K funcH(T t)$/;" f typeref:typename:K template:<typename T,int I,int J=I>> V>
T input-2.hpp /^template<typename T,int I,int J = I >> V> K funcH(T t)$/;" Z function:funcH typeref:meta:typename
I input-2.hpp /^template<typename T,int I,int J = I >> V> K funcH(T t)$/;" Z function:funcH typeref:typename:int
J input-2.hpp /^template<typename T,int I,int J = I >> V> K funcH(T t)$/;" Z function:funcH typeref:typename:int
funcI input-2.hpp /^template<typename T,int I,int J = 1 >> (1+2)> K funcI(T t)$/;" f typeref:typename:K template:<typename T,int I,int J=1>> (1+2)>
T input-2.hpp /^template<typename T,int I,int J = 1 >> (1+2)> K funcI(T t)$/;" Z function:funcI typeref:meta:typename
I input-2.hpp /^template<typename T,int I,int J = 1 >> (1+2)> K funcI(T t)$/;" Z function:funcI typeref:typename:int
J input-2.hpp /^template<typename T,int I,int J = 1 >> (1+2)> K funcI(T t)$/;" Z function:funcI typeref:typename:int
funcJ input-2.hpp /^template<typename T,int I,int J = I > 2> K funcJ(T t)$/;" f typeref:typename:K template:<typename T,int I,int J=I>2>
T input-2.hpp /^template<typename T,int I,int J = I > 2> K funcJ(T t)$/;" Z function:funcJ typeref:meta:typename
I input-2.hpp /^template<typename T,int I,int J = I > 2> K funcJ(T t)$/;" Z function:funcJ typeref:typename:int
J input-2.hpp /^template<typename T,int I,int J = I > 2> K funcJ(T t)$/;" Z function:funcJ typeref:typename:int
funcK input-2.hpp /^template<typename T,int I,int J = 1 > I> K funcK(T t)$/;" f typeref:typename:K template:<typename T,int I,int J=1> I>
T input-2.hpp /^template<typename T,int I,int J = 1 > I> K funcK(T t)$/;" Z function:funcK typeref:meta:typename
I input-2.hpp /^template<typename T,int I,int J = 1 > I> K funcK(T t)$/;" Z function:funcK typeref:typename:int
J input-2.hpp /^template<typename T,int I,int J = 1 > I> K funcK(T t)$/;" Z function:funcK typeref:typename:int
funcL input-2.hpp /^template<typename T,int I,int L,int J = I > L> K funcL(T t)$/;" f typeref:typename:K template:<typename T,int I,int L,int J=I> L>
T input-2.hpp /^template<typename T,int I,int L,int J = I > L> K funcL(T t)$/;" Z function:funcL typeref:meta:typename
I input-2.hpp /^template<typename T,int I,int L,int J = I > L> K funcL(T t)$/;" Z function:funcL typeref:typename:int
L input-2.hpp /^template<typename T,int I,int L,int J = I > L> K funcL(T t)$/;" Z function:funcL typeref:typename:int
J input-2.hpp /^template<typename T,int I,int L,int J = I > L> K funcL(T t)$/;" Z function:funcL typeref:typename:int
funcO input-2.hpp /^template<typename T,int I,unsigned int J = 1 > (1+2)> K funcO(T t)$/;" f typeref:typename:K template:<typename T,int I,unsigned int J=1> (1+2)>
T input-2.hpp /^template<typename T,int I,unsigned int J = 1 > (1+2)> K funcO(T t)$/;" Z function:funcO typeref:meta:typename
I input-2.hpp /^template<typename T,int I,unsigned int J = 1 > (1+2)> K funcO(T t)$/;" Z function:funcO typeref:typename:int
J input-2.hpp /^template<typename T,int I,unsigned int J = 1 > (1+2)> K funcO(T t)$/;" Z function:funcO typeref:typename:unsigned int
funcD input-2.hpp /^template<typename T,int I,int J = (I >> 2)> K funcD(T t)$/;" f typeref:typename:K template:<typename T,int I,int J=(I>>2)>
T input-2.hpp /^template<typename T,int I,int J = (I >> 2)> K funcD(T t)$/;" Z function:funcD typeref:meta:typename
I input-2.hpp /^template<typename T,int I,int J = (I >> 2)> K funcD(T t)$/;" Z function:funcD typeref:typename:int
J input-2.hpp /^template<typename T,int I,int J = (I >> 2)> K funcD(T t)$/;" Z function:funcD typeref:typename:int
funcE input-2.hpp /^template<typename T,int I,int J = (1 >> I)> K funcE(T t)$/;" f typeref:typename:K template:<typename T,int I,int J=(1>> I)>
T input-2.hpp /^template<typename T,int I,int J = (1 >> I)> K funcE(T t)$/;" Z function:funcE typeref:meta:typename
I input-2.hpp /^template<typename T,int I,int J = (1 >> I)> K funcE(T t)$/;" Z function:funcE typeref:typename:int
J input-2.hpp /^template<typename T,int I,int J = (1 >> I)> K funcE(T t)$/;" Z function:funcE typeref:typename:int
funcF input-2.hpp /^template<typename T,int I,int L,int J = (I >> L)> K funcF(T t)$/;" f typeref:typename:K template:<typename T,int I,int L,int J=(I>> L)>
T input-2.hpp /^template<typename T,int I,int L,int J = (I >> L)> K funcF(T t)$/;" Z function:funcF typeref:meta:typename
I input-2.hpp /^template<typename T,int I,int L,int J = (I >> L)> K funcF(T t)$/;" Z function:funcF typeref:typename:int
L input-2.hpp /^template<typename T,int I,int L,int J = (I >> L)> K funcF(T t)$/;" Z function:funcF typeref:typename:int
J input-2.hpp /^template<typename T,int I,int L,int J = (I >> L)> K funcF(T t)$/;" Z function:funcF typeref:typename:int
funcG input-2.hpp /^template<typename T,int I,int J = (1 >> V)> K funcG(T t)$/;" f typeref:typename:K template:<typename T,int I,int J=(1>> V)>
T input-2.hpp /^template<typename T,int I,int J = (1 >> V)> K funcG(T t)$/;" Z function:funcG typeref:meta:typename
I input-2.hpp /^template<typename T,int I,int J = (1 >> V)> K funcG(T t)$/;" Z function:funcG typeref:typename:int
J input-2.hpp /^template<typename T,int I,int J = (1 >> V)> K funcG(T t)$/;" Z function:funcG typeref:typename:int
funcH input-2.hpp /^template<typename T,int I,int J = (I >> V)> K funcH(T t)$/;" f typeref:typename:K template:<typename T,int I,int J=(I>> V)>
T input-2.hpp /^template<typename T,int I,int J = (I >> V)> K funcH(T t)$/;" Z function:funcH typeref:meta:typename
I input-2.hpp /^template<typename T,int I,int J = (I >> V)> K funcH(T t)$/;" Z function:funcH typeref:typename:int
J input-2.hpp /^template<typename T,int I,int J = (I >> V)> K funcH(T t)$/;" Z function:funcH typeref:typename:int
funcI input-2.hpp /^template<typename T,int I,int J = (1 >> (1+2))> K funcI(T t)$/;" f typeref:typename:K template:<typename T,int I,int J=(1>> (1+2))>
T input-2.hpp /^template<typename T,int I,int J = (1 >> (1+2))> K funcI(T t)$/;" Z function:funcI typeref:meta:typename
I input-2.hpp /^template<typename T,int I,int J = (1 >> (1+2))> K funcI(T t)$/;" Z function:funcI typeref:typename:int
J input-2.hpp /^template<typename T,int I,int J = (1 >> (1+2))> K funcI(T t)$/;" Z function:funcI typeref:typename:int
funcJ input-2.hpp /^template<typename T,int I,int J = (I > 2)> K funcJ(T t)$/;" f typeref:typename:K template:<typename T,int I,int J=(I>2)>
T input-2.hpp /^template<typename T,int I,int J = (I > 2)> K funcJ(T t)$/;" Z function:funcJ typeref:meta:typename
I input-2.hpp /^template<typename T,int I,int J = (I > 2)> K funcJ(T t)$/;" Z function:funcJ typeref:typename:int
J input-2.hpp /^template<typename T,int I,int J = (I > 2)> K funcJ(T t)$/;" Z function:funcJ typeref:typename:int
funcK input-2.hpp /^template<typename T,int I,int J = (1 > I)> K funcK(T t)$/;" f typeref:typename:K template:<typename T,int I,int J=(1> I)>
T input-2.hpp /^template<typename T,int I,int J = (1 > I)> K funcK(T t)$/;" Z function:funcK typeref:meta:typename
I input-2.hpp /^template<typename T,int I,int J = (1 > I)> K funcK(T t)$/;" Z function:funcK typeref:typename:int
J input-2.hpp /^template<typename T,int I,int J = (1 > I)> K funcK(T t)$/;" Z function:funcK typeref:typename:int
funcL input-2.hpp /^template<typename T,int I,int L,int J = (I > L)> K funcL(T t)$/;" f typeref:typename:K template:<typename T,int I,int L,int J=(I> L)>
T input-2.hpp /^template<typename T,int I,int L,int J = (I > L)> K funcL(T t)$/;" Z function:funcL typeref:meta:typename
I input-2.hpp /^template<typename T,int I,int L,int J = (I > L)> K funcL(T t)$/;" Z function:funcL typeref:typename:int
L input-2.hpp /^template<typename T,int I,int L,int J = (I > L)> K funcL(T t)$/;" Z function:funcL typeref:typename:int
J input-2.hpp /^template<typename T,int I,int L,int J = (I > L)> K funcL(T t)$/;" Z function:funcL typeref:typename:int
funcO input-2.hpp /^template<typename T,int I,unsigned int J = (1 > (1+2))> K funcO(T t)$/;" f typeref:typename:K template:<typename T,int I,unsigned int J=(1> (1+2))>
T input-2.hpp /^template<typename T,int I,unsigned int J = (1 > (1+2))> K funcO(T t)$/;" Z function:funcO typeref:meta:typename
I input-2.hpp /^template<typename T,int I,unsigned int J = (1 > (1+2))> K funcO(T t)$/;" Z function:funcO typeref:typename:int
J input-2.hpp /^template<typename T,int I,unsigned int J = (1 > (1+2))> K funcO(T t)$/;" Z function:funcO typeref:typename:unsigned int
TestStruct input-3.hpp /^template <typename T> struct TestStruct {};$/;" s template:<typename T>
T input-3.hpp /^template <typename T> struct TestStruct {};$/;" Z struct:TestStruct typeref:meta:typename
TemplateParameterStruct input-3.hpp /^template <typename T> struct TemplateParameterStruct {};$/;" s template:<typename T>
Expand Down
26 changes: 15 additions & 11 deletions Units/parser-cxx.r/template-nested-triangle-brackets.d/input-2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,50 +15,54 @@ template<typename T,int I,int J = I < V> K funcC(T t)
return 0;
}

// This stuff is allowed by C++03
template<typename T,int I,int J = I >> 2> K funcD(T t)
// The original comment: This stuff is allowed by C++03
// template<typename T,int I,int J = (I >> 2)> K funcD(T t)
// However, the above input is rejected with:
// error: default template arguments may not be used in function templates
// without `-std=c++11' or `-std=gnu++11'
template<typename T,int I,int J = (I >> 2)> K funcD(T t)
{
return 0;
}

template<typename T,int I,int J = 1 >> I> K funcE(T t)
template<typename T,int I,int J = (1 >> I)> K funcE(T t)
{
return 0;
}

template<typename T,int I,int L,int J = I >> L> K funcF(T t)
template<typename T,int I,int L,int J = (I >> L)> K funcF(T t)
{
return 0;
}

template<typename T,int I,int J = 1 >> V> K funcG(T t)
template<typename T,int I,int J = (1 >> V)> K funcG(T t)
{
return 0;
}

template<typename T,int I,int J = I >> V> K funcH(T t)
template<typename T,int I,int J = (I >> V)> K funcH(T t)
{
return 0;
}

template<typename T,int I,int J = 1 >> (1+2)> K funcI(T t)
template<typename T,int I,int J = (1 >> (1+2))> K funcI(T t)
{
return 0;
}



template<typename T,int I,int J = I > 2> K funcJ(T t)
template<typename T,int I,int J = (I > 2)> K funcJ(T t)
{
return 0;
}

template<typename T,int I,int J = 1 > I> K funcK(T t)
template<typename T,int I,int J = (1 > I)> K funcK(T t)
{
return 0;
}

template<typename T,int I,int L,int J = I > L> K funcL(T t)
template<typename T,int I,int L,int J = (I > L)> K funcL(T t)
{
return 0;
}
Expand All @@ -78,7 +82,7 @@ template<typename T,int I,unsigned long int J = I > V> K funcN(T t)
}
*/

template<typename T,int I,unsigned int J = 1 > (1+2)> K funcO(T t)
template<typename T,int I,unsigned int J = (1 > (1+2))> K funcO(T t)
{
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cxx11
4 changes: 2 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ jobs:
dnf -y install git gdb
- checkout
- run:
name: Install build tools
name: Install packages for building ctags and validating test input files
command: |
dnf -y install gcc automake autoconf pkgconfig bmake libseccomp-devel libxml2-devel jansson-devel libyaml-devel pcre2-devel findutils sudo
dnf -y install jq puppet
dnf -y install g++ jq puppet
- run:
name: Build
command: |
Expand Down
3 changes: 0 additions & 3 deletions makefiles/testing.mak
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,6 @@ clean-units:
validate-input:
$(V_RUN) \
if test -n "$${ZSH_VERSION+set}"; then set -o SH_WORD_SPLIT; fi; \
if test x$(VG) = x1; then \
VALGRIND=--with-valgrind; \
fi; \
if test -n "$(VALIDATORS)"; then \
VALIDATORS="--validators=$(VALIDATORS)"; \
fi; \
Expand Down
3 changes: 2 additions & 1 deletion misc/units
Original file line number Diff line number Diff line change
Expand Up @@ -2798,7 +2798,8 @@ validate_dir ()
done | sort)

for f in $inputs; do
t=${f#input}; t=${t%.*}
t=$(basename $f)
t=${t#input}; t=${t%.*}
v=$(resolve_validator "${base_dir}"/validator"$t" \
"$default_validator" \
"$has_expected_tags" \
Expand Down
32 changes: 32 additions & 0 deletions misc/validators/validator-cxx03
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# -*- sh -*-
# validator-cxx03 - validating C++03 input files
#
# Copyright (c) 2022, Masatake YAMATO
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
STD=c++03
action=$1
input=$2
case "$action" in
is_runnable)
type g++ > /dev/null 2>&1
exit $?
;;
validate)
g++ -fsyntax-only -std=${STD} "$input" > /dev/null
exit $?
;;
esac
32 changes: 32 additions & 0 deletions misc/validators/validator-cxx11
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# -*- sh -*-
# validator-cxx11 - validating C++11 input files
#
# Copyright (c) 2022, Masatake YAMATO
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
STD=c++11
action=$1
input=$2
case "$action" in
is_runnable)
type g++ > /dev/null 2>&1
exit $?
;;
validate)
g++ -fsyntax-only -std=${STD} "$input" > /dev/null
exit $?
;;
esac

0 comments on commit 227c65e

Please sign in to comment.