Q:

Would a squad of soldiers who can shapeshift into T. Rexes be useful in a modern battle?

Take a country in the modern day, like the U.S., which routinely makes use of weapons such as guns, artillery, drones, tanks, et cetera. Now imagine that everyone in one of its elite squads of soldiers suddenly gains the power to shapeshift into a T Rex. While in Dino-form they retain full intelligence and ability to understand human speech, as well as being able to transform back and forth at will (let’s say the process takes 1-2 seconds). 
Would these new powers actually be useful in the setting of modern warfare, or a huge liability? I imagine that a T Rex would make a large target, and be less effective at killing someone than a simple gunshot. Or would the sheer intimidation factor make them a valuable asset?
Would it make a difference if instead of one squad, it was the entire army?
Edit - Answering some questions:
How big is a T. Rex? -
12 ft tall, 40 ft long, weighs possibly up to 14 tons.
Can T. Rex's swim? -
My first guess would be no, but Micheal Chrichton's T. Rex could swim, just like a crocodile. I would guess he knew a lot more about it than me.
Where does the extra mass come from? - 
They transform the same way Bruce Banner becomes the Hulk (ie. pocket universe/hand-wave?).
What happens to their clothes? -
Ripped off. If they try to transform while wrapped in steel chains or something, they would likely be seriously lacerated or strangled.
How much do they eat? -
It is viable to get hungry as a T. Rex, transform back into a human, eat, and then transform back into a T. Rex. However, they need to stay in human form long enough to digest the food and gain energy from it.
What happens to injuries when they transform? - 
If an injured human shifts to a T. Rex and back, they will still be injured, though for a sake of drama let's say that injuries that would be dangerous on the human form aren't as dire to the T Rex form. This would force people to remain as T. Rex's or bleed out!

A:

I can imagine battlefield logistics would be much easier. One of the most dangerous and common tasks for infantry is shuttling supplies back and forth between the front lines and the forward camp. If you could load up a huge pack with crates of ammunition or even vehicles, the "runner" could transform into a T-Rex, run the munitions up to the front, and transform back, being unhindered by terrain that a Humvee might have issues with.
However, in modern warfare, prolonged front line infantry fighting is becoming more and more rare, only happening in dense urban areas where a T-Rex would be a liability or when one group surprised the other. Most kills happen at pretty extreme distances nowadays.
There could be a use in peacekeeping efforts, since nothing says compliance quite like a >12 foot tall dinosaur.

A:

Stop thinking shock troops.  
Think strategic asset and later assassination.
To start with, while your were-Rex's are still a military secret, hand them over to your espionage department and get the trained in the languages and behavior traits of your target enemy nation.  Then get them behind enemy lines and integrated into your enemy's civilian populace.  They don't need to get to anything sensitive yet.  They just need access to public gathering places.  
Now, in the hours before your next major assault, have two or three of them gather in a subway central station or a big shopping mall.  Have one of the team transform and start slaughtering random citizens while running quickly through the complex.  Each time, the creature manages to obscure itself around a blind corner or in an empty hallway, have them transform back to human and signal a team mate in another part of the station to take the leading reptilian role.
Mall security guards will quickly realize that they are outmatched and will call the police.  The police will also soil their pants before calling the military.  The military will have to take key defensive resources away from your targeted (valuable) strategic target, in order to go deal with the Godzilla attack.  And as soon as those resources arrive at the mall, your were-Rex team will all switch back to human, escaping among the panicked crowds.  
Then while the enemy military is searching the mall for dinosaurs, your regular military can easily take out the undefended valuable target.
This technique would only work a few times, maybe only once.  But after that, your were-Rexes could split up and become one-man terrorist cells.  No normal security scan could find the weapon which they themselves are.  The possibilities are endless...

A:

Of course it would provide an advantage. It would provide a lot of nice advantages in fact. 
I can tell by most of the answers that the people writing them have been as close to combat as maybe their copy of Call of Duty, so I thought I'd give a little perspective. 
An elite squad with unique abilities sounds a lot like an SF team to me. Special Forces means doing a lot of things that CANNOT be replaced by a drone with a hellfire missile (in other words, lots of non-kinetic stuff). While SF teams obviously do train for kinetic situations and are really good at dealing with them, their primary use is NOT to engage a major enemy force head to head. I repeat: a modern special forces team is NOT a front line infantry unit (as most of the answers here obviously assume). 
So what does that mean? Well, they might be jumping out of an aircraft at very high altitude, drifting over a national border with steerable parachutes, silently landing in the dark at a designated point, hiking to a target, camping out invisibly in the woods, and just watching the target for a week or so. They might be looking for intel on some specific bad guy, or they might need to ID what exactly somebuilding is being used for. They might then later have to "paint" that target with a laser that guides the 500 lb bomb let go by an F-15 or something else. Then, they might have to hike out to an extraction point without being seen. In such a mission, they would ideally NEVER have to engage in direct action against the enemy force. Would being able to become a T Rex be useful? Well yeah; the hike out would sure be a lot faster if you could run over 30 miles an hour! You could also carry all sorts of stuff that might be too heavy for a regular soldier, but which might include concrete proof of the state of the enemy's WMD program or whatever they are looking for. 
Modern SF teams always have a problem when they come across potential prisoners who they could capture but who they didn't plan to encounter. They travel light and they don't have a lot of reserve for carrying extra stuff (like 200 pounds of bad guy with good intel in his still-living head). If they do encounter someone who would be a good captive, they have to make a fast judgement and figure out if he's really worth capturing or if they should kill him or turn him loose. If one guy could turn into a T Rex, they could literally incapacitate him, clip him to a harness on the 'rex, and carry him out if they thought he was useful. 
Modern SF teams use ATVs and modified dune buggies in open terrain. They have used horses to get around (like when we first went into Afghanistan). Being able to turn into your own fast moving vehicle would be very useful, especially since you don't need to carry fuel. One guy could carry the rest of the team and they could cover him while he transformed back and put his gear back on. Any open area that is not a dense city would make this useful. 
Basically all of the "getting there" and "getting out of there" parts of the mission would be excellent times to have a T Rex on the team. TO maximize this mobility, it would probably be best to spread out your 'rex soldiers among teams of regular operators so you can have many teams able to use a 'rex for transport. Say if you have 10 of these guys, you would put together ten teams with one on each, and the other guys specialized in other things like language, pilot skills, medic, explosives, etc. 
So lets say you are in a kinetic situation. There are things that your T Rex soldier would be good for. Say you are out on an open desert. You have an enemy at extreme range and you need to slow them down while the rest of the team starts to get away. You transform your guy, set a sniper up on his head, and use the height advantage to help your sniper kill enemy soldiers from farther away than they can kill you. That's kind of an edge case, since obviously a 'rex is a big target, but having an instant firing platform can be useful sometimes. Your 'rex can also become an instant elevator to lift his team mates up onto a roof (we did a LOT of climbing up onto roofs when I was infantry). 
So, worst case scenario, your small team has to actually get into it. If you are ready for it (which I assume you are, since these are elite soldiers, not idiots), you have some battle gear for the 'rex. You might have this bundled and dropped by parachute, or the 'rex can pack it in on it's back and then leave it somewhere while in dude mode, and go back to his 'rex gear when he needs to get outfitted, or he could stay in 'rex mode for the duration of a mission depending on how long it is going to be and just wear his kit like everybody else. The point is: there would be battle gear for the 'rex just like there would be for the other guys. 
In today's world: we have reversed the Napoleonic paradigm, we just don't know it yet. Materials technology has actually developed armor that can stop typical infantry weapons and can be worn by a normal person. Ceramic plates will stop a 7.62 mm NATO machine gun round, which is really impressive. The only reason we haven't gone back to the old "knights in armor"/Starship Troopers paradigm is because this kind of armor is too heavy for a guy to carry and run and climb and also carry weapons, supplies, etc. This is where it's nice to have a T Rex around. You could have ceramic plates built into the 'rex kit that make him basically a light armored vehicle, except unlike any vehicle, he can also roll, duck behind a building, jump onto a roof (a big, heavy roof), smash his way inside a building, dig himself a trench he can take cover in, etc etc etc. It wouldn't be hard to have a couple useful weapons he could strap on his arms and use a simplified trigger mechanism with either. Heck, he could have a .50 cal machine gun integrated into a headband and hit a trigger with his tongue... You really have a lot of options with something that big. Probably best would be some kind of vehicle-mount deal too big for anyone else to carry that would give your team a real advantage in firepower. I don't know, what about a 20mm anti-material rifle? A 'rex could actually haul that around! 
Basically, you get the armor and firepower of a vehicle with almost the flexibility and stealth of infantry. I guarantee a smart T Rex is a LOT quieter than an MRAP when he wants to be. Like I said, he'd also be able to get down on his belly and wriggle behind a low building or a wall for cover, unlike any vehicle ever made. So your team has some emergency heavy backup in case stuff goes sideways. He would also be pretty survivable. He would have to take a couple hits from an RPG to die with the right armor kit. 
About some of the estimates of how easy it would be to take down a T Rex with a modern firearm: I think a lot of these people answering have never hunted for big game in their lives. Look up forums where people talk about shooting a charging bull moose or a bear. They do NOT carry rifles with the kinds of caliber used by most infantry weapons! An M-4 is basically firing high-powered, tumbling versions of slightly bigger .22 rounds. This is great for chewing up a soft target roughly six feet tall and about 200 lbs, but it SERIOUSLY falls short the second you try to take down anything bigger! You try taking your M-4 up against a bull elephant and all you are going to do before he stomps you to death is piss him off real good. You put it on full auto and other than missing with half your shots, you just piss him off more, because not he has a lot of "bee stings" in his hide. More rounds do NOT mean more penetration! A T Rex, with a bone structure sort of like a crocodile, would take some VERY heavy rounds to actually penetrate anything vital! I doubt a 7.62mm NATO round would do much. You would have to rock him with a .50 cal machine gun to actually stop him. Either that or hit him with an RPG or two. The problem with an RPG is you get 1 shot at a time, they aren't fantastically accurate, and they aren't designed to hit things that zig zag, roll, or dodge. They were designed to hit the side of a tank! 
So even if he was NOT wearing armor, (which he would be), the Rex would require an elephant gun to reliably bring him down. Normal infantry units do NOT carry weapons like that! 
Once again, think about the largest crocodile ever discovered and multiply that by about 5. Now think about hitting it with a pea shooter like an AK. It just won't work out too well for you. 
In summary: it would be VERY useful for a wide variety of reasons (I didn't even get into my favorite scenario: jungle warfare!) 

