History log of /llvm-project/clang/test/SemaCXX/conditional-expr.cpp (Results 26 – 50 of 56)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-2.8.0, llvmorg-2.8.0-rc3, llvmorg-2.8.0-rc2, llvmorg-2.8.0-rc1
# 24b89469 05-Sep-2010 Chris Lattner <sabre@nondot.org>

'const std::type_info*' instead of 'std::type_info const*'

llvm-svn: 113092


Revision tags: llvmorg-2.8.0-rc0
# cb3b5a48 14-Jul-2010 Chandler Carruth <chandlerc@gmail.com>

Wire up '-Wignored-qualifiers' to the warning on 'const' in 'const int f()'.
This flag and warning match GCC semantics. Also, move it to -Wextra as this is
a largely cosmetic issue and doesn't seem t

Wire up '-Wignored-qualifiers' to the warning on 'const' in 'const int f()'.
This flag and warning match GCC semantics. Also, move it to -Wextra as this is
a largely cosmetic issue and doesn't seem to mask problems. Subsequent fixes to
the tests which no longer by default emit the warning. Added explicit test
cases for both C and C++ behavior with the warning turned on.

llvm-svn: 108325

show more ...


# e82f0873 13-Jul-2010 Douglas Gregor <dgregor@apple.com>

Improve diagnostics for the "type qualifier on return type has no
effect warning" by printing the qualifiers we saw and correctly
pluralizing the message, e.g.,

test/SemaCXX/conditional-expr.cpp:295

Improve diagnostics for the "type qualifier on return type has no
effect warning" by printing the qualifiers we saw and correctly
pluralizing the message, e.g.,

test/SemaCXX/conditional-expr.cpp:295:3: warning: 'const volatile' type
qualifiers on return type have no effect
const volatile Enum g2() {
^~~~~ ~~~~~~~~

llvm-svn: 108236

show more ...


# 603d81bf 13-Jul-2010 Douglas Gregor <dgregor@apple.com>

When forming a function call or message send expression, be sure to
strip cv-qualifiers from the expression's type when the language calls
for it: in C, that's all the time, while C++ only does it fo

When forming a function call or message send expression, be sure to
strip cv-qualifiers from the expression's type when the language calls
for it: in C, that's all the time, while C++ only does it for
non-class types.

Centralized the computation of the call expression type in
QualType::getCallResultType() and some helper functions in other nodes
(FunctionDecl, ObjCMethodDecl, FunctionType), and updated all relevant
callers of getResultType() to getCallResultType().

Fixes PR7598 and PR7463, along with a bunch of getResultType() call
sites that weren't stripping references off the result type (nothing
stripped cv-qualifiers properly before this change).

llvm-svn: 108234

show more ...


# 7c42659c 01-Jul-2010 Douglas Gregor <dgregor@apple.com>

When performing copy initialization via user-defined conversions,
don't allow two user-defined conversions. Fixes PR6595 (again).

llvm-svn: 107379


# fa6010b6 19-May-2010 Douglas Gregor <dgregor@apple.com>

When a conditional operator is an rvalue of class type, we need to
create a temporary copy of both the "true" and "false" results. Fixes
the Boost.Interprocess failures.

Daniel did all the hard work

When a conditional operator is an rvalue of class type, we need to
create a temporary copy of both the "true" and "false" results. Fixes
the Boost.Interprocess failures.

Daniel did all the hard work of tracking down the issue, I get to type
up the trivial fix for this horrible miscompile.

llvm-svn: 104184

show more ...


# cc7e5bff 06-May-2010 John McCall <rjmccall@apple.com>

Rearchitect -Wconversion and -Wsign-compare. Instead of computing them
"bottom-up" when implicit casts and comparisons are inserted, compute them
"top-down" when the full expression is finished. Ma

Rearchitect -Wconversion and -Wsign-compare. Instead of computing them
"bottom-up" when implicit casts and comparisons are inserted, compute them
"top-down" when the full expression is finished. Makes it easier to
coordinate warnings and thus implement -Wconversion for signedness
conversions without double-warning with -Wsign-compare. Also makes it possible
to realize that a signedness conversion is okay because the context is
performing the inverse conversion. Also simplifies some logic that was
trying to calculate the ultimate comparison/result type and getting it wrong.
Also fixes a problem with the C++ explicit casts which are often "implemented"
in the AST with a series of implicit cast expressions.

llvm-svn: 103174

show more ...


Revision tags: llvmorg-2.7.0
# c779e995 24-Apr-2010 Douglas Gregor <dgregor@apple.com>

When we are performing copy initialization of a class type via its
copy constructor, suppress user-defined conversions on the
argument. Otherwise, we can end up in a recursion loop where the
bind the

When we are performing copy initialization of a class type via its
copy constructor, suppress user-defined conversions on the
argument. Otherwise, we can end up in a recursion loop where the
bind the argument of the copy constructor to another copy constructor call,
whose argument is then a copy constructor call...

Found by Boost.Regex which, alas, still isn't building.

llvm-svn: 102269

show more ...


# 5ab11655 17-Apr-2010 Douglas Gregor <dgregor@apple.com>

Improve our handling of user-defined conversions as part of overload
resolution. There are two sources of problems involving user-defined
conversions that this change eliminates, along with providing

Improve our handling of user-defined conversions as part of overload
resolution. There are two sources of problems involving user-defined
conversions that this change eliminates, along with providing simpler
interfaces for checking implicit conversions:

- It eliminates a case of infinite recursion found in Boost.

- It eliminates the search for the constructor needed to copy a temporary
generated by an implicit conversion from overload
resolution. Overload resolution assumes that, if it gets a value
of the parameter's class type (or a derived class thereof), there
is a way to copy if... even if there isn't. We now model this
properly.

llvm-svn: 101680

show more ...


# 3155f573 09-Apr-2010 John McCall <rjmccall@apple.com>

Turn access control on by default in -cc1.
Remove -faccess-control from -cc1; add -fno-access-control.
Make the driver pass -fno-access-control by default.
Update a bunch of tests to be correct under

Turn access control on by default in -cc1.
Remove -faccess-control from -cc1; add -fno-access-control.
Make the driver pass -fno-access-control by default.
Update a bunch of tests to be correct under access control.

llvm-svn: 100880

show more ...


# 45cf7e3d 02-Apr-2010 Douglas Gregor <dgregor@apple.com>

Rework our handling of copy construction of temporaries, which was a
poor (and wrong) approximation of the actual rules governing when to
build a copy and when it can be elided.

The correct implemen

Rework our handling of copy construction of temporaries, which was a
poor (and wrong) approximation of the actual rules governing when to
build a copy and when it can be elided.

The correct implementation is actually simpler than the
approximation. When we only enumerate constructors as part of
initialization (e.g., for direct initialization or when we're copying
from a class type or one of its derived classes), we don't create a
copy. When we enumerate all conversion functions, we do create a
copy. Before, we created some extra copies and missed some
others. The new test copy-initialization.cpp shows a case where we
missed creating a (required, non-elidable) copy as part of a
user-defined conversion, which resulted in a miscompile. This commit
also fixes PR6757, where the missing copy made us reject well-formed
code in the ternary operator.

This commit also cleans up our handling of copy elision in the case
where we create an extra copy of a temporary object, which became
necessary now that we produce the right copies. The code that seeks to
find the temporary object being copied has moved into
Expr::getTemporaryObject(); it used to have two different
not-quite-the-same implementations, one in Sema and one in CodeGen.

Note that we still do not attempt to perform the named return value
optimization, so we miss copy elisions for return values and throw
expressions.

llvm-svn: 100196

show more ...


# f9edf80c 26-Mar-2010 Douglas Gregor <dgregor@apple.com>

When trying to determine whether one operand of a conditional
expression can be converted to the type of another, only apply the
lvalue-to-rvalue conversion to the type of the expression we're
conver

When trying to determine whether one operand of a conditional
expression can be converted to the type of another, only apply the
lvalue-to-rvalue conversion to the type of the expression we're
converting, *not* the array-to-pointer or function-to-pointer
conversions. Fixes PR6595.

llvm-svn: 99652

show more ...


# 838fcc31 26-Mar-2010 Douglas Gregor <dgregor@apple.com>

Switch semantic analysis of the conditional operator from using
CheckReferenceInit to using the new initialization sequence code.

llvm-svn: 99647


# ce5cbdc4 19-Mar-2010 John McCall <rjmccall@apple.com>

Promote enum types during -Wsign-compare. Fixes some spurious warnings,
mostly during conditional expressions.

llvm-svn: 98975


# 85f90559 10-Mar-2010 John McCall <rjmccall@apple.com>

When pretty-printing tag types, only print the tag if we're in C (and
therefore not creating ElaboratedTypes, which are still pretty-printed
with the written tag).

Most of these testcase changes wer

When pretty-printing tag types, only print the tag if we're in C (and
therefore not creating ElaboratedTypes, which are still pretty-printed
with the written tag).

Most of these testcase changes were done by script, so don't feel too
sorry for my fingers.

llvm-svn: 98149

show more ...


# 5b0829a3 10-Feb-2010 John McCall <rjmccall@apple.com>

Improve access control diagnostics. Perform access control on member-pointer
conversions. Fix an access-control bug where privileges were not considered
at intermediate points along the inheritance

Improve access control diagnostics. Perform access control on member-pointer
conversions. Fix an access-control bug where privileges were not considered
at intermediate points along the inheritance path. Prepare for friends.

llvm-svn: 95775

show more ...


# c54cf737 12-Jan-2010 John McCall <rjmccall@apple.com>

Chris thinks these diagnostics are better now. :)

llvm-svn: 93216


# 0d1da229 12-Jan-2010 John McCall <rjmccall@apple.com>

Introduce a specific representation for the ambiguous implicit conversion
sequence. Lots of small relevant changes. Fixes some serious problems with
ambiguous conversions; also possibly improves a

Introduce a specific representation for the ambiguous implicit conversion
sequence. Lots of small relevant changes. Fixes some serious problems with
ambiguous conversions; also possibly improves associated diagnostics.

llvm-svn: 93214

show more ...


# 96596c98 22-Dec-2009 Douglas Gregor <dgregor@apple.com>

Switch initialization of parameters in a call over to
InitializationSequence (when a FunctionDecl is present). This required
a few small fixes to initialization sequences:

- Make sure to use the a

Switch initialization of parameters in a call over to
InitializationSequence (when a FunctionDecl is present). This required
a few small fixes to initialization sequences:

- Make sure to use the adjusted parameter type for initialization of
function parameters.
- Implement transparent union calling semantics in C

llvm-svn: 91902

show more ...


# 8fbe78f6 15-Dec-2009 Daniel Dunbar <daniel@zuster.org>

Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
- This is designed to make it obvious that %clang_cc1 is a "test variable"
which is substituted. It is '%clang_cc1' instead o

Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
- This is designed to make it obvious that %clang_cc1 is a "test variable"
which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
can be useful to redefine what gets run as 'clang -cc1' (for example, to set
a default target).

llvm-svn: 91446

show more ...


# 6af6c3ee 06-Nov-2009 Douglas Gregor <dgregor@apple.com>

Turn off -Wsign-compare warnings by default

llvm-svn: 86233


# 1fa36b7c 05-Nov-2009 John McCall <rjmccall@apple.com>

Implement the conditional-operator part of -Wsign-compare. Turn
DiagnoseSignCompare into Sema::CheckSignCompare and call it from more places.

Add some enumerator tests. These seem to expose some o

Implement the conditional-operator part of -Wsign-compare. Turn
DiagnoseSignCompare into Sema::CheckSignCompare and call it from more places.

Add some enumerator tests. These seem to expose some oddities in the
types we're converting C++ enumerators to; in particular, they're converting
to unsigned before int, which seems to contradict 4.5 [conv.prom] p2.

Note to self: stop baiting Doug in my commit messages.

llvm-svn: 86128

show more ...


Revision tags: llvmorg-2.6.0
# 3fa58d1f 14-Sep-2009 Anders Carlsson <andersca@mac.com>

Diagnose taking the address of a bit-field inside a conditional operator.

llvm-svn: 81808


# b00b10eb 24-Aug-2009 Douglas Gregor <dgregor@apple.com>

Implement support for equality comparisons (!=, ==) of member
pointers, by extending the "composite pointer type" logic to include
member pointer types.

Introduce test cases for member pointer compa

Implement support for equality comparisons (!=, ==) of member
pointers, by extending the "composite pointer type" logic to include
member pointer types.

Introduce test cases for member pointer comparisons, including those
that involve the builtin operator candidates implemented earlier.

llvm-svn: 79925

show more ...


# 5879fbd9 13-May-2009 Anders Carlsson <andersca@mac.com>

Disable access control by default. It can be enabled with the -faccess-control option. When we have better support for it, we can enable it by default again.

llvm-svn: 71706


123