Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
099e3b93
Commit
099e3b93
authored
Dec 09, 2009
by
zhanyong.wan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Makes gmock_doctor work with gcc 4.4.0.
parent
a95c6a5a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
+18
-9
gmock_doctor.py
scripts/gmock_doctor.py
+18
-9
No files found.
scripts/gmock_doctor.py
View file @
099e3b93
...
...
@@ -366,11 +366,17 @@ def _TypeInTemplatedBaseDiagnoser1(msg):
type.
"""
regex
=
(
r'In member function \'int .*\n'
+
_FILE_LINE_RE
+
r'error: a function call cannot appear in a constant-expression'
)
gcc_4_3_1_regex
=
(
r'In member function \'int .*\n'
+
_FILE_LINE_RE
+
r'error: a function call cannot appear in a constant-expression'
)
gcc_4_4_0_regex
=
(
r'error: a function call cannot appear in a constant-expression'
+
_FILE_LINE_RE
+
r'error: template argument 1 is invalid\n'
)
diagnosis
=
_TTB_DIAGNOSIS
%
{
'type'
:
'Foo'
}
return
_GenericDiagnoser
(
'TTB'
,
'Type in Template Base'
,
regex
,
diagnosis
,
msg
)
return
(
list
(
_GenericDiagnoser
(
'TTB'
,
'Type in Template Base'
,
gcc_4_3_1_regex
,
diagnosis
,
msg
))
+
list
(
_GenericDiagnoser
(
'TTB'
,
'Type in Template Base'
,
gcc_4_4_0_regex
,
diagnosis
,
msg
)))
def
_TypeInTemplatedBaseDiagnoser2
(
msg
):
...
...
@@ -380,8 +386,7 @@ def _TypeInTemplatedBaseDiagnoser2(msg):
parameter type.
"""
regex
=
(
r'In member function \'int .*\n'
+
_FILE_LINE_RE
+
regex
=
(
_FILE_LINE_RE
+
r'error: \'(?P<type>.+)\' was not declared in this scope\n'
r'.*error: template argument 1 is invalid\n'
)
return
_GenericDiagnoser
(
'TTB'
,
'Type in Template Base'
,
...
...
@@ -458,9 +463,13 @@ _DIAGNOSERS = [
def
Diagnose
(
msg
):
"""Generates all possible diagnoses given the gcc error message."""
diagnoses
=
[]
for
diagnoser
in
_DIAGNOSERS
:
for
diagnosis
in
diagnoser
(
msg
):
yield
'[
%
s -
%
s]
\n
%
s'
%
diagnosis
for
diag
in
diagnoser
(
msg
):
diagnosis
=
'[
%
s -
%
s]
\n
%
s'
%
diag
if
not
diagnosis
in
diagnoses
:
diagnoses
.
append
(
diagnosis
)
return
diagnoses
def
main
():
...
...
@@ -474,7 +483,7 @@ def main():
print
'Waiting for compiler errors on stdin . . .'
msg
=
sys
.
stdin
.
read
()
.
strip
()
diagnoses
=
list
(
Diagnose
(
msg
)
)
diagnoses
=
Diagnose
(
msg
)
count
=
len
(
diagnoses
)
if
not
count
:
print
'
\n
Gcc complained:'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment